(module $huff_enc.wasm
  (type (;0;) (func (param i32 i32)))
  (type (;1;) (func))
  (type (;2;) (func (param i32)))
  (type (;3;) (func (param i32 i32 i32)))
  (type (;4;) (func (param i32) (result i32)))
  (type (;5;) (func (result i32)))
  (import "__pragma" "loopbound" (func $__pragma_loopbound (type 0)))
  (func $__wasm_apply_data_relocs (type 1))
  (func $huff_enc_write_header (type 2) (param i32)
    (local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32)
    global.get $__stack_pointer
    i32.const 80
    i32.sub
    local.tee 1
    global.set $__stack_pointer
    i32.const 256
    i32.const 256
    call $__pragma_loopbound
    i32.const 0
    local.set 2
    i32.const 0
    local.set 3
    loop  ;; label = @1
      local.get 3
      local.get 0
      local.get 2
      i32.add
      local.tee 4
      i32.const 32
      i32.add
      i32.load
      i32.const 0
      i32.ne
      i32.add
      local.get 4
      i32.const 68
      i32.add
      i32.load
      i32.const 0
      i32.ne
      i32.add
      local.get 4
      i32.const 104
      i32.add
      i32.load
      i32.const 0
      i32.ne
      i32.add
      local.get 4
      i32.const 140
      i32.add
      i32.load
      i32.const 0
      i32.ne
      i32.add
      local.set 3
      local.get 2
      i32.const 144
      i32.add
      local.tee 2
      i32.const 9216
      i32.ne
      br_if 0 (;@1;)
    end
    i32.const 1
    i32.const 9
    call $__pragma_loopbound
    i32.const 0
    i32.load8_u offset=3088
    i32.const 1
    i32.shl
    local.set 4
    i32.const 0
    i32.load8_u offset=3089
    local.set 2
    block  ;; label = @1
      block  ;; label = @2
        block  ;; label = @3
          block  ;; label = @4
            block  ;; label = @5
              block  ;; label = @6
                block  ;; label = @7
                  block  ;; label = @8
                    block  ;; label = @9
                      local.get 3
                      i32.const 31
                      i32.gt_u
                      br_if 0 (;@9;)
                      block  ;; label = @10
                        block  ;; label = @11
                          local.get 2
                          i32.const 255
                          i32.and
                          i32.const 7
                          i32.ne
                          br_if 0 (;@11;)
                          i32.const 0
                          local.set 2
                          i32.const 0
                          i32.load offset=2052
                          local.tee 5
                          i32.const 2064
                          i32.add
                          local.get 4
                          i32.store8
                          i32.const 0
                          local.get 5
                          i32.const 1
                          i32.add
                          i32.store offset=2052
                          i32.const 0
                          local.set 4
                          br 1 (;@10;)
                        end
                        local.get 2
                        i32.const 1
                        i32.add
                        local.set 2
                      end
                      i32.const 0
                      local.set 5
                      i32.const 0
                      local.get 4
                      i32.store8 offset=3088
                      i32.const 0
                      local.get 2
                      i32.store8 offset=3089
                      i32.const 1
                      i32.const 9
                      call $__pragma_loopbound
                      local.get 3
                      i32.const 255
                      i32.add
                      local.tee 2
                      i32.const 4
                      i32.shr_u
                      i32.const 1
                      i32.and
                      i32.const 0
                      i32.load8_u offset=3088
                      i32.const 1
                      i32.shl
                      i32.or
                      local.set 3
                      i32.const 0
                      i32.load offset=2052
                      local.set 4
                      block  ;; label = @10
                        i32.const 0
                        i32.load8_u offset=3089
                        local.tee 6
                        i32.const 7
                        i32.ne
                        br_if 0 (;@10;)
                        local.get 4
                        i32.const 2064
                        i32.add
                        local.get 3
                        i32.store8
                        i32.const 0
                        local.get 4
                        i32.const 1
                        i32.add
                        local.tee 4
                        i32.store offset=2052
                        local.get 2
                        i32.const 3
                        i32.shr_u
                        i32.const 1
                        i32.and
                        local.set 3
                        br 2 (;@8;)
                      end
                      local.get 2
                      i32.const 3
                      i32.shr_u
                      i32.const 1
                      i32.and
                      local.get 3
                      i32.const 1
                      i32.shl
                      i32.const 510
                      i32.and
                      i32.or
                      local.set 3
                      local.get 6
                      i32.const 1
                      i32.add
                      local.tee 5
                      i32.const 255
                      i32.and
                      i32.const 7
                      i32.ne
                      br_if 1 (;@8;)
                      local.get 4
                      i32.const 2064
                      i32.add
                      local.get 3
                      i32.store8
                      i32.const 0
                      local.set 5
                      i32.const 0
                      local.get 4
                      i32.const 1
                      i32.add
                      local.tee 4
                      i32.store offset=2052
                      local.get 2
                      i32.const 2
                      i32.shr_u
                      i32.const 1
                      i32.and
                      local.set 3
                      br 2 (;@7;)
                    end
                    local.get 4
                    i32.const 1
                    i32.or
                    local.set 4
                    block  ;; label = @9
                      block  ;; label = @10
                        local.get 2
                        i32.const 255
                        i32.and
                        i32.const 7
                        i32.ne
                        br_if 0 (;@10;)
                        i32.const 0
                        local.set 2
                        i32.const 0
                        i32.load offset=2052
                        local.tee 3
                        i32.const 2064
                        i32.add
                        local.get 4
                        i32.store8
                        i32.const 0
                        local.get 3
                        i32.const 1
                        i32.add
                        i32.store offset=2052
                        i32.const 0
                        local.set 4
                        br 1 (;@9;)
                      end
                      local.get 2
                      i32.const 1
                      i32.add
                      local.set 2
                    end
                    i32.const 0
                    local.get 4
                    i32.store8 offset=3088
                    i32.const 0
                    local.get 2
                    i32.store8 offset=3089
                    i32.const 32
                    local.set 2
                    loop  ;; label = @9
                      local.get 0
                      local.get 2
                      i32.add
                      i32.load
                      local.set 5
                      i32.const 1
                      i32.const 9
                      call $__pragma_loopbound
                      i32.const 0
                      i32.load8_u offset=3088
                      i32.const 1
                      i32.shl
                      local.set 4
                      i32.const 0
                      i32.load8_u offset=3089
                      local.set 3
                      block  ;; label = @10
                        block  ;; label = @11
                          block  ;; label = @12
                            local.get 5
                            i32.eqz
                            br_if 0 (;@12;)
                            local.get 4
                            i32.const 1
                            i32.or
                            local.set 4
                            local.get 3
                            i32.const 255
                            i32.and
                            i32.const 7
                            i32.ne
                            br_if 1 (;@11;)
                            i32.const 0
                            local.set 3
                            i32.const 0
                            i32.load offset=2052
                            local.tee 5
                            i32.const 2064
                            i32.add
                            local.get 4
                            i32.store8
                            i32.const 0
                            local.get 5
                            i32.const 1
                            i32.add
                            i32.store offset=2052
                            i32.const 0
                            local.set 4
                            br 2 (;@10;)
                          end
                          local.get 3
                          i32.const 255
                          i32.and
                          i32.const 7
                          i32.ne
                          br_if 0 (;@11;)
                          i32.const 0
                          local.set 3
                          i32.const 0
                          i32.load offset=2052
                          local.tee 5
                          i32.const 2064
                          i32.add
                          local.get 4
                          i32.store8
                          i32.const 0
                          local.get 5
                          i32.const 1
                          i32.add
                          i32.store offset=2052
                          i32.const 0
                          local.set 4
                          br 1 (;@10;)
                        end
                        local.get 3
                        i32.const 1
                        i32.add
                        local.set 3
                      end
                      i32.const 0
                      local.get 4
                      i32.store8 offset=3088
                      i32.const 0
                      local.get 3
                      i32.store8 offset=3089
                      local.get 2
                      i32.const 36
                      i32.add
                      local.tee 2
                      i32.const 9248
                      i32.ne
                      br_if 0 (;@9;)
                      br 8 (;@1;)
                    end
                  end
                  i32.const 1
                  local.set 6
                  local.get 2
                  i32.const 2
                  i32.shr_u
                  i32.const 1
                  i32.and
                  local.get 3
                  i32.const 1
                  i32.shl
                  i32.const 510
                  i32.and
                  i32.or
                  local.set 3
                  local.get 5
                  i32.const 1
                  i32.add
                  local.tee 5
                  i32.const 255
                  i32.and
                  i32.const 7
                  i32.ne
                  br_if 0 (;@7;)
                  i32.const 3
                  local.set 7
                  br 1 (;@6;)
                end
                i32.const 1
                local.set 7
                local.get 2
                i32.const 1
                i32.shr_u
                i32.const 1
                i32.and
                local.get 3
                i32.const 1
                i32.shl
                i32.const 510
                i32.and
                i32.or
                local.set 3
                local.get 5
                i32.const 255
                i32.and
                i32.const 6
                i32.ne
                br_if 1 (;@5;)
                i32.const 0
                local.set 6
              end
              local.get 4
              i32.const 2064
              i32.add
              local.get 3
              i32.store8
              i32.const 0
              local.get 4
              i32.const 1
              i32.add
              i32.store offset=2052
              local.get 7
              local.get 2
              i32.and
              local.set 2
              br 1 (;@4;)
            end
            local.get 2
            i32.const 1
            i32.and
            local.get 3
            i32.const 1
            i32.shl
            i32.or
            local.set 2
            local.get 5
            i32.const 2
            i32.add
            local.tee 6
            i32.const 255
            i32.and
            i32.const 7
            i32.eq
            br_if 1 (;@3;)
          end
          local.get 6
          i32.const 1
          i32.add
          local.set 3
          br 1 (;@2;)
        end
        local.get 4
        i32.const 2064
        i32.add
        local.get 2
        i32.store8
        i32.const 0
        local.set 3
        i32.const 0
        local.get 4
        i32.const 1
        i32.add
        i32.store offset=2052
        i32.const 0
        local.set 2
      end
      i32.const 0
      local.get 2
      i32.store8 offset=3088
      i32.const 0
      local.get 3
      i32.store8 offset=3089
      local.get 0
      i32.const 32
      i32.add
      local.set 3
      i32.const 0
      local.set 4
      loop  ;; label = @2
        block  ;; label = @3
          local.get 3
          i32.load
          i32.eqz
          br_if 0 (;@3;)
          i32.const 1
          i32.const 9
          call $__pragma_loopbound
          local.get 4
          i32.const 7
          i32.shr_u
          i32.const 1
          i32.and
          i32.const 0
          i32.load8_u offset=3088
          i32.const 1
          i32.shl
          i32.or
          local.set 5
          i32.const 0
          i32.load offset=2052
          local.set 2
          block  ;; label = @4
            block  ;; label = @5
              block  ;; label = @6
                block  ;; label = @7
                  block  ;; label = @8
                    block  ;; label = @9
                      block  ;; label = @10
                        i32.const 0
                        i32.load8_u offset=3089
                        local.tee 6
                        i32.const 7
                        i32.ne
                        br_if 0 (;@10;)
                        local.get 2
                        i32.const 2064
                        i32.add
                        local.get 5
                        i32.store8
                        i32.const 0
                        local.get 2
                        i32.const 1
                        i32.add
                        local.tee 2
                        i32.store offset=2052
                        local.get 4
                        i32.const 5
                        i32.shr_u
                        i32.const 3
                        i32.and
                        local.set 5
                        i32.const 2
                        local.set 6
                        br 1 (;@9;)
                      end
                      local.get 4
                      i32.const 6
                      i32.shr_u
                      i32.const 1
                      i32.and
                      local.get 5
                      i32.const 1
                      i32.shl
                      i32.or
                      local.set 5
                      local.get 6
                      i32.const 6
                      i32.ne
                      br_if 1 (;@8;)
                      local.get 2
                      i32.const 2064
                      i32.add
                      local.get 5
                      i32.store8
                      i32.const 1
                      local.set 6
                      i32.const 0
                      local.get 2
                      i32.const 1
                      i32.add
                      local.tee 2
                      i32.store offset=2052
                      local.get 4
                      i32.const 5
                      i32.shr_u
                      i32.const 1
                      i32.and
                      local.set 5
                    end
                    local.get 4
                    i32.const 4
                    i32.shr_u
                    i32.const 1
                    i32.and
                    local.get 5
                    i32.const 1
                    i32.shl
                    i32.or
                    local.set 5
                    br 1 (;@7;)
                  end
                  local.get 4
                  i32.const 5
                  i32.shr_u
                  i32.const 1
                  i32.and
                  local.get 5
                  i32.const 1
                  i32.shl
                  i32.or
                  local.set 5
                  block  ;; label = @8
                    block  ;; label = @9
                      local.get 6
                      i32.const 5
                      i32.ne
                      br_if 0 (;@9;)
                      local.get 2
                      i32.const 2064
                      i32.add
                      local.get 5
                      i32.store8
                      i32.const 0
                      local.get 2
                      i32.const 1
                      i32.add
                      local.tee 2
                      i32.store offset=2052
                      local.get 4
                      i32.const 3
                      i32.shr_u
                      i32.const 3
                      i32.and
                      local.set 5
                      i32.const 2
                      local.set 6
                      br 1 (;@8;)
                    end
                    local.get 4
                    i32.const 4
                    i32.shr_u
                    i32.const 1
                    i32.and
                    local.get 5
                    i32.const 1
                    i32.shl
                    i32.or
                    local.set 5
                    local.get 6
                    i32.const 3
                    i32.add
                    local.tee 6
                    i32.const 255
                    i32.and
                    i32.const 7
                    i32.ne
                    br_if 1 (;@7;)
                    local.get 2
                    i32.const 2064
                    i32.add
                    local.get 5
                    i32.store8
                    i32.const 1
                    local.set 6
                    i32.const 0
                    local.get 2
                    i32.const 1
                    i32.add
                    local.tee 2
                    i32.store offset=2052
                    local.get 4
                    i32.const 3
                    i32.shr_u
                    i32.const 1
                    i32.and
                    local.set 5
                  end
                  local.get 4
                  i32.const 2
                  i32.shr_u
                  i32.const 1
                  i32.and
                  local.get 5
                  i32.const 1
                  i32.shl
                  i32.or
                  local.set 5
                  br 1 (;@6;)
                end
                local.get 4
                i32.const 3
                i32.shr_u
                i32.const 1
                i32.and
                local.get 5
                i32.const 1
                i32.shl
                i32.or
                local.set 5
                block  ;; label = @7
                  local.get 6
                  i32.const 255
                  i32.and
                  i32.const 6
                  i32.ne
                  br_if 0 (;@7;)
                  i32.const 2
                  local.set 7
                  i32.const 7
                  local.set 6
                  br 2 (;@5;)
                end
                i32.const 1
                local.set 7
                local.get 4
                i32.const 2
                i32.shr_u
                i32.const 1
                i32.and
                local.get 5
                i32.const 1
                i32.shl
                i32.or
                local.set 5
                local.get 6
                i32.const 2
                i32.add
                local.tee 6
                i32.const 255
                i32.and
                i32.const 7
                i32.ne
                br_if 0 (;@6;)
                i32.const 3
                local.set 6
                br 1 (;@5;)
              end
              local.get 4
              i32.const 1
              i32.shr_u
              i32.const 1
              i32.and
              local.get 5
              i32.const 1
              i32.shl
              i32.or
              local.set 5
              block  ;; label = @6
                local.get 6
                i32.const 255
                i32.and
                i32.const 6
                i32.ne
                br_if 0 (;@6;)
                local.get 2
                i32.const 2064
                i32.add
                local.get 5
                i32.store8
                i32.const 0
                local.get 2
                i32.const 1
                i32.add
                i32.store offset=2052
                local.get 4
                i32.const 1
                i32.and
                local.set 5
                i32.const 0
                i32.const 1
                i32.add
                local.set 6
                br 2 (;@4;)
              end
              local.get 4
              i32.const 1
              i32.and
              local.get 5
              i32.const 1
              i32.shl
              i32.or
              local.set 5
              block  ;; label = @6
                local.get 6
                i32.const 2
                i32.add
                local.tee 6
                i32.const 255
                i32.and
                i32.const 7
                i32.eq
                br_if 0 (;@6;)
                local.get 6
                i32.const 1
                i32.add
                local.set 6
                br 2 (;@4;)
              end
              local.get 2
              i32.const 2064
              i32.add
              local.get 5
              i32.store8
              i32.const 0
              local.set 6
              i32.const 0
              local.get 2
              i32.const 1
              i32.add
              i32.store offset=2052
              i32.const 0
              local.set 5
              br 1 (;@4;)
            end
            local.get 2
            i32.const 2064
            i32.add
            local.get 5
            i32.store8
            i32.const 0
            local.get 2
            i32.const 1
            i32.add
            i32.store offset=2052
            local.get 4
            local.get 6
            i32.and
            local.set 5
            local.get 7
            i32.const 1
            i32.add
            local.set 6
          end
          i32.const 0
          local.get 5
          i32.store8 offset=3088
          i32.const 0
          local.get 6
          i32.store8 offset=3089
        end
        local.get 3
        i32.const 36
        i32.add
        local.set 3
        local.get 4
        i32.const 1
        i32.add
        local.tee 4
        i32.const 256
        i32.ne
        br_if 0 (;@2;)
      end
    end
    i32.const 257
    i32.const 257
    call $__pragma_loopbound
    local.get 1
    i32.const 40
    i32.add
    i32.const 1
    i32.or
    local.set 8
    i32.const 0
    local.set 9
    loop  ;; label = @1
      block  ;; label = @2
        local.get 0
        local.get 9
        i32.const 36
        i32.mul
        i32.add
        local.tee 2
        i32.load offset=32
        local.tee 5
        i32.eqz
        br_if 0 (;@2;)
        i32.const 1
        i32.const 9
        call $__pragma_loopbound
        i32.const 0
        i32.load8_u offset=3088
        i32.const 1
        i32.shl
        local.set 4
        i32.const 0
        i32.load8_u offset=3089
        local.set 3
        block  ;; label = @3
          block  ;; label = @4
            local.get 5
            i32.const 32
            i32.gt_u
            br_if 0 (;@4;)
            block  ;; label = @5
              local.get 3
              i32.const 255
              i32.and
              i32.const 7
              i32.ne
              br_if 0 (;@5;)
              i32.const 0
              local.set 6
              i32.const 0
              i32.load offset=2052
              local.tee 3
              i32.const 2064
              i32.add
              local.get 4
              i32.store8
              i32.const 0
              local.get 3
              i32.const 1
              i32.add
              i32.store offset=2052
              i32.const 5
              local.set 3
              i32.const 0
              local.set 4
              br 2 (;@3;)
            end
            local.get 3
            i32.const 1
            i32.add
            local.set 6
            i32.const 5
            local.set 3
            br 1 (;@3;)
          end
          local.get 4
          i32.const 1
          i32.or
          local.set 4
          block  ;; label = @4
            local.get 3
            i32.const 255
            i32.and
            i32.const 7
            i32.ne
            br_if 0 (;@4;)
            i32.const 0
            local.set 6
            i32.const 0
            i32.load offset=2052
            local.tee 3
            i32.const 2064
            i32.add
            local.get 4
            i32.store8
            i32.const 0
            local.get 3
            i32.const 1
            i32.add
            i32.store offset=2052
            i32.const 8
            local.set 3
            i32.const 0
            local.set 4
            br 1 (;@3;)
          end
          local.get 3
          i32.const 1
          i32.add
          local.set 6
          i32.const 8
          local.set 3
        end
        i32.const 0
        local.get 4
        i32.store8 offset=3088
        i32.const 0
        local.get 6
        i32.store8 offset=3089
        local.get 8
        local.get 1
        i64.load offset=9 align=1
        i64.store align=1
        local.get 8
        i32.const 8
        i32.add
        local.get 1
        i32.const 9
        i32.add
        i32.const 8
        i32.add
        i64.load align=1
        i64.store align=1
        local.get 8
        i32.const 16
        i32.add
        local.get 1
        i32.const 9
        i32.add
        i32.const 16
        i32.add
        i64.load align=1
        i64.store align=1
        local.get 8
        i32.const 23
        i32.add
        local.get 1
        i32.const 9
        i32.add
        i32.const 23
        i32.add
        i64.load align=1
        i64.store align=1
        local.get 1
        local.get 5
        i32.const -1
        i32.add
        i32.store8 offset=40
        local.get 1
        local.get 3
        i32.store offset=72
        i32.const 1
        i32.const 9
        call $__pragma_loopbound
        local.get 3
        i32.const -2
        i32.add
        i32.const 7
        local.get 3
        i32.const -1
        i32.add
        local.tee 4
        select
        local.set 3
        local.get 1
        i32.load8_u offset=40
        local.get 4
        i32.const 255
        i32.and
        i32.shr_u
        i32.const 1
        i32.and
        i32.const 0
        i32.load8_u offset=3088
        i32.const 1
        i32.shl
        i32.or
        local.set 6
        i32.const 0
        i32.const -1
        local.get 4
        select
        local.set 7
        i32.const 0
        i32.load offset=2052
        local.set 4
        block  ;; label = @3
          block  ;; label = @4
            i32.const 0
            i32.load8_u offset=3089
            local.tee 10
            i32.const 7
            i32.ne
            br_if 0 (;@4;)
            local.get 4
            i32.const 2064
            i32.add
            local.get 6
            i32.store8
            i32.const 0
            local.set 11
            i32.const 0
            local.get 4
            i32.const 1
            i32.add
            local.tee 4
            i32.store offset=2052
            i32.const 0
            local.set 6
            br 1 (;@3;)
          end
          local.get 10
          i32.const 1
          i32.add
          local.set 11
        end
        local.get 1
        i32.const 40
        i32.add
        local.get 7
        i32.add
        local.tee 12
        i32.load8_u
        local.get 3
        i32.shr_u
        i32.const 1
        i32.and
        local.get 6
        i32.const 1
        i32.shl
        i32.or
        local.set 10
        local.get 3
        i32.const -1
        i32.add
        local.set 6
        block  ;; label = @3
          block  ;; label = @4
            local.get 11
            i32.const 255
            i32.and
            i32.const 7
            i32.eq
            br_if 0 (;@4;)
            local.get 11
            i32.const 1
            i32.add
            local.set 11
            br 1 (;@3;)
          end
          local.get 4
          i32.const 2064
          i32.add
          local.get 10
          i32.store8
          i32.const 0
          local.set 11
          i32.const 0
          local.get 4
          i32.const 1
          i32.add
          local.tee 4
          i32.store offset=2052
          i32.const 0
          local.set 10
        end
        local.get 12
        i32.load8_u
        local.get 6
        i32.shr_u
        i32.const 1
        i32.and
        local.get 10
        i32.const 1
        i32.shl
        i32.or
        local.set 10
        local.get 3
        i32.const -2
        i32.add
        i32.const 7
        local.get 6
        select
        local.set 3
        local.get 7
        local.get 6
        i32.eqz
        i32.sub
        local.set 7
        block  ;; label = @3
          block  ;; label = @4
            local.get 11
            i32.const 255
            i32.and
            i32.const 7
            i32.eq
            br_if 0 (;@4;)
            local.get 11
            i32.const 1
            i32.add
            local.set 11
            br 1 (;@3;)
          end
          local.get 4
          i32.const 2064
          i32.add
          local.get 10
          i32.store8
          i32.const 0
          local.set 11
          i32.const 0
          local.get 4
          i32.const 1
          i32.add
          local.tee 4
          i32.store offset=2052
          i32.const 0
          local.set 10
        end
        local.get 1
        i32.const 40
        i32.add
        local.get 7
        i32.add
        i32.load8_u
        local.get 3
        i32.shr_u
        i32.const 1
        i32.and
        local.get 10
        i32.const 1
        i32.shl
        i32.or
        local.set 10
        local.get 3
        i32.const -1
        i32.add
        i32.const 7
        local.get 3
        select
        local.set 6
        local.get 7
        local.get 3
        i32.eqz
        i32.sub
        local.set 12
        block  ;; label = @3
          block  ;; label = @4
            local.get 11
            i32.const 255
            i32.and
            i32.const 7
            i32.eq
            br_if 0 (;@4;)
            local.get 11
            i32.const 1
            i32.add
            local.set 7
            br 1 (;@3;)
          end
          local.get 4
          i32.const 2064
          i32.add
          local.get 10
          i32.store8
          i32.const 0
          local.set 7
          i32.const 0
          local.get 4
          i32.const 1
          i32.add
          local.tee 4
          i32.store offset=2052
          i32.const 0
          local.set 10
        end
        local.get 1
        i32.const 40
        i32.add
        local.get 12
        i32.add
        i32.load8_u
        local.get 6
        i32.shr_u
        i32.const 1
        i32.and
        local.get 10
        i32.const 1
        i32.shl
        i32.or
        local.set 3
        block  ;; label = @3
          block  ;; label = @4
            local.get 7
            i32.const 255
            i32.and
            i32.const 7
            i32.eq
            br_if 0 (;@4;)
            local.get 7
            i32.const 1
            i32.add
            local.set 7
            br 1 (;@3;)
          end
          local.get 4
          i32.const 2064
          i32.add
          local.get 3
          i32.store8
          i32.const 0
          local.set 7
          i32.const 0
          local.get 4
          i32.const 1
          i32.add
          local.tee 4
          i32.store offset=2052
          i32.const 0
          local.set 3
        end
        block  ;; label = @3
          local.get 5
          i32.const 33
          i32.lt_u
          br_if 0 (;@3;)
          local.get 6
          i32.const -1
          i32.add
          i32.const 7
          local.get 6
          select
          local.tee 5
          i32.const -1
          i32.add
          i32.const 7
          local.get 5
          i32.const 255
          i32.and
          local.tee 5
          select
          local.set 10
          local.get 1
          i32.const 40
          i32.add
          local.get 12
          local.get 6
          i32.eqz
          i32.sub
          local.tee 6
          i32.add
          i32.load8_u
          local.get 5
          i32.shr_u
          i32.const 1
          i32.and
          local.get 3
          i32.const 255
          i32.and
          i32.const 1
          i32.shl
          i32.or
          local.set 3
          local.get 6
          local.get 5
          i32.eqz
          i32.sub
          local.set 5
          block  ;; label = @4
            block  ;; label = @5
              local.get 7
              i32.const 255
              i32.and
              i32.const 7
              i32.eq
              br_if 0 (;@5;)
              local.get 7
              i32.const 1
              i32.add
              local.set 7
              br 1 (;@4;)
            end
            local.get 4
            i32.const 2064
            i32.add
            local.get 3
            i32.store8
            i32.const 0
            local.set 7
            i32.const 0
            local.get 4
            i32.const 1
            i32.add
            local.tee 4
            i32.store offset=2052
            i32.const 0
            local.set 3
          end
          local.get 10
          i32.const -1
          i32.add
          i32.const 7
          local.get 10
          i32.const 255
          i32.and
          local.tee 6
          select
          local.set 10
          local.get 1
          i32.const 40
          i32.add
          local.get 5
          i32.add
          i32.load8_u
          local.get 6
          i32.shr_u
          i32.const 1
          i32.and
          local.get 3
          i32.const 1
          i32.shl
          i32.or
          local.set 3
          local.get 5
          local.get 6
          i32.eqz
          i32.sub
          local.set 6
          block  ;; label = @4
            block  ;; label = @5
              local.get 7
              i32.const 255
              i32.and
              i32.const 7
              i32.eq
              br_if 0 (;@5;)
              local.get 7
              i32.const 1
              i32.add
              local.set 5
              br 1 (;@4;)
            end
            local.get 4
            i32.const 2064
            i32.add
            local.get 3
            i32.store8
            i32.const 0
            local.set 5
            i32.const 0
            local.get 4
            i32.const 1
            i32.add
            local.tee 4
            i32.store offset=2052
            i32.const 0
            local.set 3
          end
          local.get 1
          i32.const 40
          i32.add
          local.get 6
          i32.add
          i32.load8_u
          local.get 10
          i32.const 255
          i32.and
          i32.shr_u
          i32.const 1
          i32.and
          local.get 3
          i32.const 1
          i32.shl
          i32.or
          local.set 3
          block  ;; label = @4
            local.get 5
            i32.const 255
            i32.and
            i32.const 7
            i32.eq
            br_if 0 (;@4;)
            local.get 5
            i32.const 1
            i32.add
            local.set 7
            br 1 (;@3;)
          end
          local.get 4
          i32.const 2064
          i32.add
          local.get 3
          i32.store8
          i32.const 0
          local.set 7
          i32.const 0
          local.get 4
          i32.const 1
          i32.add
          i32.store offset=2052
          i32.const 0
          local.set 3
        end
        i32.const 0
        local.get 3
        i32.store8 offset=3088
        i32.const 0
        local.get 7
        i32.store8 offset=3089
        local.get 1
        i32.const 40
        i32.add
        i32.const 24
        i32.add
        local.get 2
        i32.const 24
        i32.add
        i64.load align=1
        i64.store
        local.get 1
        i32.const 40
        i32.add
        i32.const 16
        i32.add
        local.get 2
        i32.const 16
        i32.add
        i64.load align=1
        i64.store
        local.get 1
        i32.const 40
        i32.add
        i32.const 8
        i32.add
        local.get 2
        i32.const 8
        i32.add
        i64.load align=1
        i64.store
        local.get 1
        i32.const 40
        i32.add
        i32.const 32
        i32.add
        local.get 2
        i32.const 32
        i32.add
        i32.load align=1
        local.tee 11
        i32.store
        local.get 1
        local.get 2
        i64.load align=1
        i64.store offset=40
        i32.const 1
        i32.const 9
        call $__pragma_loopbound
        local.get 11
        i32.eqz
        br_if 0 (;@2;)
        local.get 11
        i32.const -1
        i32.add
        local.tee 2
        i32.const 7
        i32.and
        local.set 4
        local.get 2
        i32.const 3
        i32.shr_u
        local.set 2
        i32.const 0
        i32.load8_u offset=3088
        local.set 6
        i32.const 0
        i32.load8_u offset=3089
        local.set 5
        i32.const 0
        i32.load offset=2052
        local.set 12
        i32.const 1
        local.set 7
        loop  ;; label = @3
          local.get 1
          i32.const 40
          i32.add
          local.get 2
          i32.add
          i32.load8_u
          local.get 4
          i32.const 255
          i32.and
          local.tee 3
          i32.shr_u
          i32.const 1
          i32.and
          local.get 6
          i32.const 255
          i32.and
          i32.const 1
          i32.shl
          i32.or
          local.set 6
          local.get 3
          i32.eqz
          local.set 10
          block  ;; label = @4
            block  ;; label = @5
              local.get 5
              i32.const 255
              i32.and
              i32.const 7
              i32.ne
              br_if 0 (;@5;)
              local.get 12
              i32.const 2064
              i32.add
              local.get 6
              i32.store8
              i32.const 0
              local.set 5
              i32.const 0
              local.get 12
              i32.const 1
              i32.add
              local.tee 12
              i32.store offset=2052
              i32.const 0
              local.set 6
              br 1 (;@4;)
            end
            local.get 5
            i32.const 1
            i32.add
            local.set 5
          end
          local.get 4
          i32.const -1
          i32.add
          i32.const 7
          local.get 3
          select
          local.set 4
          local.get 2
          local.get 10
          i32.sub
          local.set 2
          local.get 11
          local.get 7
          i32.const 1
          i32.add
          local.tee 7
          i32.const 255
          i32.and
          i32.ge_u
          br_if 0 (;@3;)
        end
        i32.const 0
        local.get 6
        i32.store8 offset=3088
        i32.const 0
        local.get 5
        i32.store8 offset=3089
      end
      local.get 9
      i32.const 1
      i32.add
      local.tee 9
      i32.const 257
      i32.ne
      br_if 0 (;@1;)
    end
    local.get 1
    i32.const 80
    i32.add
    global.set $__stack_pointer)
  (func $huff_enc_qsort (type 3) (param i32 i32 i32)
    (local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32)
    i32.const 0
    i32.const 7
    call $__pragma_loopbound
    block  ;; label = @1
      local.get 1
      i32.const 2
      i32.lt_u
      br_if 0 (;@1;)
      local.get 2
      i32.const -4
      i32.and
      local.set 3
      local.get 2
      i32.const 3
      i32.and
      local.set 4
      local.get 2
      i32.const -1
      i32.add
      local.set 5
      i32.const 0
      local.get 2
      i32.sub
      local.set 6
      loop  ;; label = @2
        block  ;; label = @3
          block  ;; label = @4
            local.get 1
            i32.const 11
            i32.lt_u
            br_if 0 (;@4;)
            local.get 0
            local.get 1
            i32.const 6
            i32.div_u
            local.get 2
            i32.mul
            local.tee 7
            i32.add
            local.tee 8
            local.get 7
            i32.const 1
            i32.shl
            local.tee 7
            i32.add
            local.tee 9
            local.get 7
            i32.add
            local.tee 10
            i32.load
            i32.load offset=4
            local.set 11
            block  ;; label = @5
              local.get 9
              i32.load
              i32.load offset=4
              local.tee 12
              local.get 8
              i32.load
              i32.load offset=4
              local.tee 13
              i32.ge_u
              br_if 0 (;@5;)
              local.get 8
              local.set 7
              local.get 11
              local.get 13
              i32.ge_u
              br_if 2 (;@3;)
              local.get 9
              local.get 10
              local.get 11
              local.get 12
              i32.lt_u
              select
              local.set 7
              br 2 (;@3;)
            end
            local.get 9
            local.set 7
            local.get 11
            local.get 12
            i32.ge_u
            br_if 1 (;@3;)
            local.get 8
            local.get 10
            local.get 11
            local.get 13
            i32.lt_u
            select
            local.set 7
            br 1 (;@3;)
          end
          local.get 0
          local.get 1
          i32.const 1
          i32.shr_u
          local.get 2
          i32.mul
          i32.add
          local.set 7
        end
        i32.const 8
        i32.const 8
        call $__pragma_loopbound
        block  ;; label = @3
          block  ;; label = @4
            local.get 4
            br_if 0 (;@4;)
            local.get 0
            local.set 8
            local.get 2
            local.set 9
            br 1 (;@3;)
          end
          local.get 4
          local.set 9
          local.get 0
          local.set 8
          loop  ;; label = @4
            local.get 8
            i32.load8_u
            local.set 11
            local.get 8
            local.get 7
            i32.load8_u
            i32.store8
            local.get 7
            local.get 11
            i32.store8
            local.get 7
            i32.const 1
            i32.add
            local.set 7
            local.get 8
            i32.const 1
            i32.add
            local.set 8
            local.get 9
            i32.const -1
            i32.add
            local.tee 9
            br_if 0 (;@4;)
          end
          local.get 3
          local.set 9
        end
        block  ;; label = @3
          local.get 5
          i32.const 3
          i32.lt_u
          local.tee 14
          br_if 0 (;@3;)
          loop  ;; label = @4
            local.get 8
            i32.load8_u
            local.set 11
            local.get 8
            local.get 7
            i32.load8_u
            i32.store8
            local.get 7
            local.get 11
            i32.store8
            local.get 8
            i32.const 1
            i32.add
            local.tee 11
            i32.load8_u
            local.set 12
            local.get 11
            local.get 7
            i32.const 1
            i32.add
            local.tee 13
            i32.load8_u
            i32.store8
            local.get 13
            local.get 12
            i32.store8
            local.get 8
            i32.const 2
            i32.add
            local.tee 11
            i32.load8_u
            local.set 12
            local.get 11
            local.get 7
            i32.const 2
            i32.add
            local.tee 13
            i32.load8_u
            i32.store8
            local.get 13
            local.get 12
            i32.store8
            local.get 8
            i32.const 3
            i32.add
            local.tee 11
            i32.load8_u
            local.set 12
            local.get 11
            local.get 7
            i32.const 3
            i32.add
            local.tee 13
            i32.load8_u
            i32.store8
            local.get 13
            local.get 12
            i32.store8
            local.get 8
            i32.const 4
            i32.add
            local.set 8
            local.get 7
            i32.const 4
            i32.add
            local.set 7
            local.get 9
            i32.const -4
            i32.add
            local.tee 9
            br_if 0 (;@4;)
          end
        end
        i32.const 0
        i32.const 109
        call $__pragma_loopbound
        local.get 0
        local.set 9
        local.get 0
        local.get 1
        local.get 2
        i32.mul
        i32.add
        local.tee 15
        local.set 10
        block  ;; label = @3
          loop  ;; label = @4
            i32.const 1
            i32.const 19
            call $__pragma_loopbound
            local.get 9
            local.get 2
            i32.add
            local.set 7
            block  ;; label = @5
              loop  ;; label = @6
                local.get 7
                local.tee 9
                local.get 15
                i32.ge_u
                br_if 1 (;@5;)
                local.get 9
                local.get 2
                i32.add
                local.set 7
                local.get 0
                i32.load
                i32.load offset=4
                local.get 9
                i32.load
                i32.load offset=4
                i32.lt_u
                br_if 0 (;@6;)
              end
            end
            i32.const 1
            i32.const 25
            call $__pragma_loopbound
            local.get 6
            local.set 7
            block  ;; label = @5
              loop  ;; label = @6
                local.get 10
                local.get 7
                local.tee 11
                i32.add
                local.tee 13
                local.get 0
                i32.le_u
                br_if 1 (;@5;)
                local.get 11
                local.get 2
                i32.sub
                local.set 7
                local.get 0
                i32.load
                i32.load offset=4
                local.get 13
                i32.load
                i32.load offset=4
                i32.gt_u
                br_if 0 (;@6;)
              end
            end
            i32.const 8
            i32.const 8
            call $__pragma_loopbound
            block  ;; label = @5
              block  ;; label = @6
                local.get 13
                local.get 9
                i32.ge_u
                br_if 0 (;@6;)
                local.get 10
                local.get 11
                i32.add
                local.set 7
                block  ;; label = @7
                  block  ;; label = @8
                    local.get 4
                    br_if 0 (;@8;)
                    local.get 0
                    local.set 8
                    local.get 2
                    local.set 9
                    br 1 (;@7;)
                  end
                  local.get 4
                  local.set 9
                  local.get 0
                  local.set 8
                  loop  ;; label = @8
                    local.get 8
                    i32.load8_u
                    local.set 12
                    local.get 8
                    local.get 7
                    i32.load8_u
                    i32.store8
                    local.get 7
                    local.get 12
                    i32.store8
                    local.get 7
                    i32.const 1
                    i32.add
                    local.set 7
                    local.get 8
                    i32.const 1
                    i32.add
                    local.set 8
                    local.get 9
                    i32.const -1
                    i32.add
                    local.tee 9
                    br_if 0 (;@8;)
                  end
                  local.get 3
                  local.set 9
                end
                block  ;; label = @7
                  local.get 14
                  br_if 0 (;@7;)
                  loop  ;; label = @8
                    local.get 8
                    i32.load8_u
                    local.set 12
                    local.get 8
                    local.get 7
                    i32.load8_u
                    i32.store8
                    local.get 7
                    local.get 12
                    i32.store8
                    local.get 8
                    i32.const 1
                    i32.add
                    local.tee 12
                    i32.load8_u
                    local.set 13
                    local.get 12
                    local.get 7
                    i32.const 1
                    i32.add
                    local.tee 16
                    i32.load8_u
                    i32.store8
                    local.get 16
                    local.get 13
                    i32.store8
                    local.get 8
                    i32.const 2
                    i32.add
                    local.tee 12
                    i32.load8_u
                    local.set 13
                    local.get 12
                    local.get 7
                    i32.const 2
                    i32.add
                    local.tee 16
                    i32.load8_u
                    i32.store8
                    local.get 16
                    local.get 13
                    i32.store8
                    local.get 8
                    i32.const 3
                    i32.add
                    local.tee 12
                    i32.load8_u
                    local.set 13
                    local.get 12
                    local.get 7
                    i32.const 3
                    i32.add
                    local.tee 16
                    i32.load8_u
                    i32.store8
                    local.get 16
                    local.get 13
                    i32.store8
                    local.get 8
                    i32.const 4
                    i32.add
                    local.set 8
                    local.get 7
                    i32.const 4
                    i32.add
                    local.set 7
                    local.get 9
                    i32.const -4
                    i32.add
                    local.tee 9
                    br_if 0 (;@8;)
                  end
                end
                local.get 10
                local.get 0
                i32.sub
                local.get 11
                i32.add
                local.get 2
                i32.div_u
                local.tee 7
                local.get 1
                local.get 7
                i32.const -1
                i32.xor
                i32.add
                local.tee 1
                i32.lt_u
                br_if 1 (;@5;)
                local.get 0
                local.get 7
                local.get 2
                call $huff_enc_qsort
                local.get 0
                local.get 7
                i32.const 1
                i32.add
                local.get 2
                i32.mul
                i32.add
                local.set 0
                br 3 (;@3;)
              end
              local.get 9
              local.set 7
              local.get 13
              local.set 8
              local.get 2
              local.set 12
              block  ;; label = @6
                local.get 4
                i32.eqz
                br_if 0 (;@6;)
                local.get 10
                local.get 11
                i32.add
                local.set 10
                i32.const 0
                local.set 8
                loop  ;; label = @7
                  local.get 9
                  local.get 8
                  i32.add
                  local.tee 7
                  i32.load8_u
                  local.set 11
                  local.get 7
                  local.get 10
                  local.get 8
                  i32.add
                  local.tee 12
                  i32.load8_u
                  i32.store8
                  local.get 12
                  local.get 11
                  i32.store8
                  local.get 4
                  local.get 8
                  i32.const 1
                  i32.add
                  local.tee 8
                  i32.ne
                  br_if 0 (;@7;)
                end
                local.get 2
                local.get 8
                i32.sub
                local.set 12
                local.get 9
                local.get 8
                i32.add
                local.set 7
                local.get 10
                local.get 8
                i32.add
                local.set 8
              end
              local.get 13
              local.set 10
              local.get 14
              br_if 1 (;@4;)
              loop  ;; label = @6
                local.get 7
                i32.load8_u
                local.set 11
                local.get 7
                local.get 8
                i32.load8_u
                i32.store8
                local.get 8
                local.get 11
                i32.store8
                local.get 7
                i32.const 1
                i32.add
                local.tee 11
                i32.load8_u
                local.set 10
                local.get 11
                local.get 8
                i32.const 1
                i32.add
                local.tee 16
                i32.load8_u
                i32.store8
                local.get 16
                local.get 10
                i32.store8
                local.get 7
                i32.const 2
                i32.add
                local.tee 11
                i32.load8_u
                local.set 10
                local.get 11
                local.get 8
                i32.const 2
                i32.add
                local.tee 16
                i32.load8_u
                i32.store8
                local.get 16
                local.get 10
                i32.store8
                local.get 7
                i32.const 3
                i32.add
                local.tee 11
                i32.load8_u
                local.set 10
                local.get 11
                local.get 8
                i32.const 3
                i32.add
                local.tee 16
                i32.load8_u
                i32.store8
                local.get 16
                local.get 10
                i32.store8
                local.get 7
                i32.const 4
                i32.add
                local.set 7
                local.get 8
                i32.const 4
                i32.add
                local.set 8
                local.get 12
                i32.const -4
                i32.add
                local.tee 12
                br_if 0 (;@6;)
              end
              local.get 13
              local.set 10
              br 1 (;@4;)
            end
          end
          local.get 0
          local.get 7
          i32.const 1
          i32.add
          local.get 2
          i32.mul
          i32.add
          local.get 1
          local.get 2
          call $huff_enc_qsort
          local.get 7
          local.set 1
        end
        local.get 1
        i32.const 1
        i32.gt_u
        br_if 0 (;@2;)
      end
    end)
  (func $huff_enc_build_tree_encoding (type 4) (param i32) (result i32)
    (local i32 i32 i32 i32 i32)
    global.get $__stack_pointer
    i32.const 1040
    i32.sub
    local.tee 1
    global.set $__stack_pointer
    i32.const 257
    i32.const 257
    call $__pragma_loopbound
    local.get 1
    local.set 2
    local.get 0
    local.set 3
    i32.const 0
    local.set 4
    block  ;; label = @1
      loop  ;; label = @2
        local.get 3
        local.get 4
        i32.store
        local.get 2
        local.get 3
        i32.store
        local.get 3
        i32.const 12
        i32.add
        i32.const 0
        i32.store
        local.get 3
        i32.const 4
        i32.add
        i64.const 0
        i64.store align=4
        local.get 4
        i32.const 256
        i32.eq
        br_if 1 (;@1;)
        local.get 3
        i32.const 28
        i32.add
        i32.const 0
        i32.store
        local.get 3
        i32.const 20
        i32.add
        i64.const 0
        i64.store align=4
        local.get 3
        i32.const 16
        i32.add
        local.tee 5
        local.get 4
        i32.const 1
        i32.add
        i32.store
        local.get 2
        i32.const 4
        i32.add
        local.get 5
        i32.store
        local.get 4
        i32.const 2
        i32.add
        local.set 4
        local.get 2
        i32.const 8
        i32.add
        local.set 2
        local.get 3
        i32.const 32
        i32.add
        local.set 3
        br 0 (;@2;)
      end
    end
    block  ;; label = @1
      i32.const 0
      i32.load offset=2048
      i32.const 599
      i32.gt_s
      br_if 0 (;@1;)
      i32.const 600
      i32.const 600
      call $__pragma_loopbound
      block  ;; label = @2
        i32.const 0
        i32.load offset=2048
        local.tee 4
        i32.const 599
        i32.gt_s
        br_if 0 (;@2;)
        local.get 4
        local.set 3
        block  ;; label = @3
          local.get 4
          i32.const 1
          i32.and
          i32.eqz
          br_if 0 (;@3;)
          local.get 1
          local.get 4
          i32.const 1443
          i32.add
          i32.load8_s
          i32.const 2
          i32.shl
          i32.add
          i32.load
          local.tee 3
          local.get 3
          i32.load offset=4
          i32.const 1
          i32.add
          i32.store offset=4
          local.get 4
          i32.const 1
          i32.add
          local.set 3
        end
        block  ;; label = @3
          local.get 4
          i32.const 599
          i32.eq
          br_if 0 (;@3;)
          loop  ;; label = @4
            local.get 1
            local.get 3
            i32.const 1443
            i32.add
            i32.load8_s
            i32.const 2
            i32.shl
            i32.add
            i32.load
            local.tee 4
            local.get 4
            i32.load offset=4
            i32.const 1
            i32.add
            i32.store offset=4
            local.get 1
            local.get 3
            i32.const 1444
            i32.add
            i32.load8_s
            i32.const 2
            i32.shl
            i32.add
            i32.load
            local.tee 4
            local.get 4
            i32.load offset=4
            i32.const 1
            i32.add
            i32.store offset=4
            local.get 3
            i32.const 2
            i32.add
            local.tee 3
            i32.const 600
            i32.ne
            br_if 0 (;@4;)
          end
        end
        i32.const 0
        i32.const 600
        i32.store offset=2048
      end
      local.get 1
      i32.load offset=1024
      i32.const 1
      i32.store offset=4
      local.get 1
      i32.const 257
      i32.const 4
      call $huff_enc_qsort
      local.get 1
      i32.const 1012
      i32.add
      local.set 3
      i32.const 253
      local.set 4
      block  ;; label = @2
        block  ;; label = @3
          block  ;; label = @4
            block  ;; label = @5
              block  ;; label = @6
                loop  ;; label = @7
                  local.get 3
                  i32.const 12
                  i32.add
                  i32.load
                  i32.load offset=4
                  br_if 2 (;@5;)
                  local.get 3
                  i32.const 8
                  i32.add
                  i32.load
                  i32.load offset=4
                  br_if 1 (;@6;)
                  local.get 3
                  i32.const 4
                  i32.add
                  i32.load
                  i32.load offset=4
                  br_if 3 (;@4;)
                  local.get 3
                  i32.load
                  i32.load offset=4
                  br_if 4 (;@3;)
                  local.get 3
                  i32.const -16
                  i32.add
                  local.set 3
                  local.get 4
                  i32.const -4
                  i32.add
                  local.tee 4
                  i32.const -3
                  i32.ne
                  br_if 0 (;@7;)
                end
                i32.const 38
                i32.const 38
                call $__pragma_loopbound
                i32.const 1
                local.set 2
                br 4 (;@2;)
              end
              local.get 4
              i32.const 2
              i32.add
              local.set 4
              br 2 (;@3;)
            end
            local.get 4
            i32.const 3
            i32.add
            local.set 4
            br 1 (;@3;)
          end
          local.get 4
          i32.const 1
          i32.add
          local.set 4
        end
        i32.const 38
        i32.const 38
        call $__pragma_loopbound
        local.get 4
        i32.const 1
        i32.add
        local.tee 2
        i32.eqz
        br_if 1 (;@1;)
      end
      local.get 0
      i32.const 4112
      i32.add
      local.set 3
      loop  ;; label = @2
        local.get 3
        i32.const 257
        i32.store
        local.get 3
        i32.const 8
        i32.add
        local.get 1
        local.get 2
        i32.const -1
        i32.add
        local.tee 4
        i32.const 2
        i32.shl
        i32.add
        i32.load
        local.tee 5
        i32.store
        local.get 3
        i32.const 4
        i32.add
        local.tee 0
        local.get 5
        i32.load offset=4
        local.tee 5
        i32.store
        block  ;; label = @3
          block  ;; label = @4
            local.get 4
            br_if 0 (;@4;)
            i32.const 0
            local.set 2
            i32.const 0
            local.set 4
            br 1 (;@3;)
          end
          local.get 0
          local.get 1
          local.get 2
          i32.const -2
          i32.add
          local.tee 4
          i32.const 2
          i32.shl
          i32.add
          i32.load
          local.tee 2
          i32.load offset=4
          local.get 5
          i32.add
          i32.store
        end
        local.get 3
        i32.const 12
        i32.add
        local.get 2
        i32.store
        local.get 1
        local.get 4
        i32.const 2
        i32.shl
        i32.add
        local.get 3
        i32.store
        local.get 1
        local.get 4
        i32.const 1
        i32.add
        local.tee 2
        i32.const 4
        call $huff_enc_qsort
        local.get 3
        i32.const 16
        i32.add
        local.set 3
        local.get 4
        br_if 0 (;@2;)
      end
    end
    local.get 1
    i32.load
    local.set 3
    local.get 1
    i32.const 1040
    i32.add
    global.set $__stack_pointer
    local.get 3)
  (func $huff_enc_encode_codes_table (type 3) (param i32 i32 i32)
    (local i32 i32 i32 i32 i32)
    global.get $__stack_pointer
    i32.const 48
    i32.sub
    local.tee 3
    global.set $__stack_pointer
    block  ;; label = @1
      block  ;; label = @2
        local.get 0
        i32.load
        local.tee 4
        i32.const 257
        i32.ne
        br_if 0 (;@2;)
        block  ;; label = @3
          local.get 0
          i32.load offset=8
          i32.eqz
          br_if 0 (;@3;)
          local.get 3
          i32.const 8
          i32.add
          i32.const 32
          i32.add
          local.get 2
          i32.const 32
          i32.add
          i32.load
          i32.store
          local.get 3
          i32.const 8
          i32.add
          i32.const 24
          i32.add
          local.get 2
          i32.const 24
          i32.add
          i64.load align=4
          i64.store
          local.get 3
          i32.const 8
          i32.add
          i32.const 16
          i32.add
          local.get 2
          i32.const 16
          i32.add
          i64.load align=4
          i64.store
          local.get 3
          i32.const 8
          i32.add
          i32.const 8
          i32.add
          local.get 2
          i32.const 8
          i32.add
          i64.load align=4
          i64.store
          local.get 3
          local.get 2
          i64.load align=4
          i64.store offset=8
          i32.const 31
          i32.const 31
          call $__pragma_loopbound
          local.get 2
          i32.load8_u offset=31
          local.set 5
          i32.const 0
          local.set 4
          block  ;; label = @4
            loop  ;; label = @5
              local.get 2
              local.get 4
              i32.add
              local.tee 6
              i32.const 31
              i32.add
              local.get 5
              i32.const 1
              i32.shl
              local.get 6
              i32.const 30
              i32.add
              local.tee 7
              i32.load8_u
              local.tee 5
              i32.const 7
              i32.shr_u
              i32.const 1
              i32.and
              i32.or
              i32.store8
              local.get 4
              i32.const -30
              i32.eq
              br_if 1 (;@4;)
              local.get 7
              local.get 5
              i32.const 1
              i32.shl
              local.get 6
              i32.const 29
              i32.add
              i32.load8_u
              local.tee 5
              i32.const 7
              i32.shr_u
              i32.const 1
              i32.and
              i32.or
              i32.store8
              local.get 4
              i32.const -2
              i32.add
              local.set 4
              br 0 (;@5;)
            end
          end
          local.get 2
          local.get 2
          i32.load8_u
          i32.const 1
          i32.shl
          i32.const 1
          i32.or
          i32.store8
          local.get 2
          i32.const 32
          i32.add
          local.tee 4
          local.get 4
          i32.load
          i32.const 1
          i32.add
          i32.store
          local.get 0
          i32.load offset=8
          local.get 1
          local.get 2
          call $huff_enc_encode_codes_table
          local.get 4
          local.get 3
          i32.const 8
          i32.add
          i32.const 32
          i32.add
          i32.load
          i32.store
          local.get 2
          i32.const 24
          i32.add
          local.get 3
          i32.const 8
          i32.add
          i32.const 24
          i32.add
          i64.load
          i64.store align=4
          local.get 2
          i32.const 16
          i32.add
          local.get 3
          i32.const 8
          i32.add
          i32.const 16
          i32.add
          i64.load
          i64.store align=4
          local.get 2
          i32.const 8
          i32.add
          local.get 3
          i32.const 8
          i32.add
          i32.const 8
          i32.add
          i64.load
          i64.store align=4
          local.get 2
          local.get 3
          i64.load offset=8
          i64.store align=4
        end
        local.get 0
        i32.load offset=12
        i32.eqz
        br_if 1 (;@1;)
        local.get 3
        i32.const 8
        i32.add
        i32.const 32
        i32.add
        local.get 2
        i32.const 32
        i32.add
        i32.load
        i32.store
        local.get 3
        i32.const 8
        i32.add
        i32.const 24
        i32.add
        local.get 2
        i32.const 24
        i32.add
        i64.load align=4
        i64.store
        local.get 3
        i32.const 8
        i32.add
        i32.const 16
        i32.add
        local.get 2
        i32.const 16
        i32.add
        i64.load align=4
        i64.store
        local.get 3
        i32.const 8
        i32.add
        i32.const 8
        i32.add
        local.get 2
        i32.const 8
        i32.add
        i64.load align=4
        i64.store
        local.get 3
        local.get 2
        i64.load align=4
        i64.store offset=8
        i32.const 31
        i32.const 31
        call $__pragma_loopbound
        local.get 2
        i32.load8_u offset=31
        local.set 5
        i32.const 0
        local.set 4
        block  ;; label = @3
          loop  ;; label = @4
            local.get 2
            local.get 4
            i32.add
            local.tee 6
            i32.const 31
            i32.add
            local.get 5
            i32.const 1
            i32.shl
            local.get 6
            i32.const 30
            i32.add
            local.tee 7
            i32.load8_u
            local.tee 5
            i32.const 7
            i32.shr_u
            i32.const 1
            i32.and
            i32.or
            i32.store8
            local.get 4
            i32.const -30
            i32.eq
            br_if 1 (;@3;)
            local.get 7
            local.get 5
            i32.const 1
            i32.shl
            local.get 6
            i32.const 29
            i32.add
            i32.load8_u
            local.tee 5
            i32.const 7
            i32.shr_u
            i32.const 1
            i32.and
            i32.or
            i32.store8
            local.get 4
            i32.const -2
            i32.add
            local.set 4
            br 0 (;@4;)
          end
        end
        local.get 2
        local.get 2
        i32.load8_u
        i32.const 1
        i32.shl
        i32.store8
        local.get 2
        i32.const 32
        i32.add
        local.tee 4
        local.get 4
        i32.load
        i32.const 1
        i32.add
        i32.store
        local.get 0
        i32.load offset=12
        local.get 1
        local.get 2
        call $huff_enc_encode_codes_table
        local.get 4
        local.get 3
        i32.const 8
        i32.add
        i32.const 32
        i32.add
        i32.load
        i32.store
        local.get 2
        i32.const 24
        i32.add
        local.get 3
        i32.const 8
        i32.add
        i32.const 24
        i32.add
        i64.load
        i64.store align=4
        local.get 2
        i32.const 16
        i32.add
        local.get 3
        i32.const 8
        i32.add
        i32.const 16
        i32.add
        i64.load
        i64.store align=4
        local.get 2
        i32.const 8
        i32.add
        local.get 3
        i32.const 8
        i32.add
        i32.const 8
        i32.add
        i64.load
        i64.store align=4
        local.get 2
        local.get 3
        i64.load offset=8
        i64.store align=4
        br 1 (;@1;)
      end
      local.get 1
      local.get 4
      i32.const 36
      i32.mul
      i32.add
      local.tee 4
      local.get 2
      i64.load align=4
      i64.store align=4
      local.get 4
      i32.const 32
      i32.add
      local.get 2
      i32.const 32
      i32.add
      i32.load
      i32.store
      local.get 4
      i32.const 24
      i32.add
      local.get 2
      i32.const 24
      i32.add
      i64.load align=4
      i64.store align=4
      local.get 4
      i32.const 16
      i32.add
      local.get 2
      i32.const 16
      i32.add
      i64.load align=4
      i64.store align=4
      local.get 4
      i32.const 8
      i32.add
      local.get 2
      i32.const 8
      i32.add
      i64.load align=4
      i64.store align=4
    end
    local.get 3
    i32.const 48
    i32.add
    global.set $__stack_pointer)
  (func $huff_enc_create_codes_table (type 0) (param i32 i32)
    (local i32 i32 i32)
    global.get $__stack_pointer
    i32.const 48
    i32.sub
    local.tee 2
    global.set $__stack_pointer
    i32.const 32
    i32.const 32
    call $__pragma_loopbound
    local.get 2
    i32.const 0
    i32.store offset=44
    local.get 2
    i64.const 0
    i64.store offset=36 align=4
    local.get 2
    i64.const 0
    i64.store offset=28 align=4
    local.get 2
    i64.const 0
    i64.store offset=20 align=4
    local.get 2
    i64.const 0
    i64.store offset=12 align=4
    i32.const 257
    i32.const 257
    call $__pragma_loopbound
    i32.const 0
    local.set 3
    loop  ;; label = @1
      i32.const 32
      i32.const 32
      call $__pragma_loopbound
      local.get 1
      local.get 3
      i32.add
      local.tee 4
      i64.const 0
      i64.store align=1
      local.get 4
      i32.const 32
      i32.add
      i32.const 0
      i32.store
      local.get 4
      i32.const 24
      i32.add
      i64.const 0
      i64.store align=1
      local.get 4
      i32.const 16
      i32.add
      i64.const 0
      i64.store align=1
      local.get 4
      i32.const 8
      i32.add
      i64.const 0
      i64.store align=1
      local.get 3
      i32.const 36
      i32.add
      local.tee 3
      i32.const 9252
      i32.ne
      br_if 0 (;@1;)
    end
    local.get 0
    local.get 1
    local.get 2
    i32.const 12
    i32.add
    call $huff_enc_encode_codes_table
    local.get 2
    i32.const 48
    i32.add
    global.set $__stack_pointer)
  (func $huff_enc_main (type 1)
    (local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32)
    global.get $__stack_pointer
    i32.const 17536
    i32.sub
    local.tee 0
    global.set $__stack_pointer
    block  ;; label = @1
      i32.const 0
      i32.load offset=2048
      i32.const 599
      i32.gt_s
      br_if 0 (;@1;)
      local.get 0
      i32.const 9264
      i32.add
      call $huff_enc_build_tree_encoding
      local.get 0
      call $huff_enc_create_codes_table
      local.get 0
      call $huff_enc_write_header
      i32.const 0
      i32.const 0
      i32.store offset=2048
      i32.const 600
      i32.const 600
      call $__pragma_loopbound
      block  ;; label = @2
        i32.const 0
        i32.load offset=2048
        local.tee 1
        i32.const 599
        i32.gt_s
        br_if 0 (;@2;)
        loop  ;; label = @3
          i32.const 0
          local.get 1
          i32.const 1
          i32.add
          i32.store offset=2048
          local.get 0
          i32.const 17496
          i32.add
          i32.const 24
          i32.add
          local.get 0
          local.get 1
          i32.const 1443
          i32.add
          i32.load8_u
          i32.const 36
          i32.mul
          i32.add
          local.tee 1
          i32.const 24
          i32.add
          i64.load align=4
          i64.store
          local.get 0
          i32.const 17496
          i32.add
          i32.const 16
          i32.add
          local.get 1
          i32.const 16
          i32.add
          i64.load align=4
          i64.store
          local.get 0
          i32.const 17496
          i32.add
          i32.const 8
          i32.add
          local.get 1
          i32.const 8
          i32.add
          i64.load align=4
          i64.store
          local.get 0
          i32.const 17496
          i32.add
          i32.const 32
          i32.add
          local.get 1
          i32.const 32
          i32.add
          i32.load
          local.tee 2
          i32.store
          local.get 0
          local.get 1
          i64.load align=4
          i64.store offset=17496
          i32.const 1
          i32.const 9
          call $__pragma_loopbound
          block  ;; label = @4
            local.get 2
            i32.eqz
            br_if 0 (;@4;)
            local.get 2
            i32.const -1
            i32.add
            local.tee 3
            i32.const 7
            i32.and
            local.set 1
            local.get 3
            i32.const 3
            i32.shr_u
            local.set 3
            i32.const 0
            i32.load8_u offset=3088
            local.set 4
            i32.const 0
            i32.load8_u offset=3089
            local.set 5
            i32.const 0
            i32.load offset=2052
            local.set 6
            i32.const 1
            local.set 7
            loop  ;; label = @5
              local.get 0
              i32.const 17496
              i32.add
              local.get 3
              i32.add
              i32.load8_u
              local.get 1
              i32.const 255
              i32.and
              local.tee 8
              i32.shr_u
              i32.const 1
              i32.and
              local.get 4
              i32.const 255
              i32.and
              i32.const 1
              i32.shl
              i32.or
              local.set 4
              local.get 8
              i32.eqz
              local.set 9
              block  ;; label = @6
                block  ;; label = @7
                  local.get 5
                  i32.const 255
                  i32.and
                  i32.const 7
                  i32.ne
                  br_if 0 (;@7;)
                  local.get 6
                  i32.const 2064
                  i32.add
                  local.get 4
                  i32.store8
                  i32.const 0
                  local.set 5
                  i32.const 0
                  local.get 6
                  i32.const 1
                  i32.add
                  local.tee 6
                  i32.store offset=2052
                  i32.const 0
                  local.set 4
                  br 1 (;@6;)
                end
                local.get 5
                i32.const 1
                i32.add
                local.set 5
              end
              local.get 1
              i32.const -1
              i32.add
              i32.const 7
              local.get 8
              select
              local.set 1
              local.get 3
              local.get 9
              i32.sub
              local.set 3
              local.get 2
              local.get 7
              i32.const 1
              i32.add
              local.tee 7
              i32.const 255
              i32.and
              i32.ge_u
              br_if 0 (;@5;)
            end
            i32.const 0
            local.get 4
            i32.store8 offset=3088
            i32.const 0
            local.get 5
            i32.store8 offset=3089
          end
          i32.const 0
          i32.load offset=2048
          local.tee 1
          i32.const 600
          i32.lt_s
          br_if 0 (;@3;)
        end
      end
      local.get 0
      i32.const 17520
      i32.add
      local.get 0
      i32.const 9240
      i32.add
      i64.load
      i64.store
      local.get 0
      i32.const 17512
      i32.add
      local.get 0
      i32.const 9232
      i32.add
      i64.load
      i64.store
      local.get 0
      i32.const 17504
      i32.add
      local.get 0
      i32.const 9224
      i32.add
      i64.load
      i64.store
      local.get 0
      i32.const 17528
      i32.add
      local.get 0
      i32.const 9248
      i32.add
      i32.load
      local.tee 2
      i32.store
      local.get 0
      local.get 0
      i64.load offset=9216
      i64.store offset=17496
      i32.const 1
      i32.const 9
      call $__pragma_loopbound
      block  ;; label = @2
        block  ;; label = @3
          local.get 2
          i32.eqz
          br_if 0 (;@3;)
          local.get 2
          i32.const -1
          i32.add
          local.tee 3
          i32.const 7
          i32.and
          local.set 1
          local.get 3
          i32.const 3
          i32.shr_u
          local.set 3
          i32.const 0
          i32.load8_u offset=3088
          local.set 4
          i32.const 0
          i32.load8_u offset=3089
          local.set 5
          i32.const 0
          i32.load offset=2052
          local.set 6
          i32.const 1
          local.set 7
          loop  ;; label = @4
            local.get 0
            i32.const 17496
            i32.add
            local.get 3
            i32.add
            i32.load8_u
            local.get 1
            i32.const 255
            i32.and
            local.tee 8
            i32.shr_u
            i32.const 1
            i32.and
            local.get 4
            i32.const 255
            i32.and
            i32.const 1
            i32.shl
            i32.or
            local.set 4
            local.get 8
            i32.eqz
            local.set 9
            block  ;; label = @5
              block  ;; label = @6
                local.get 5
                i32.const 255
                i32.and
                i32.const 7
                i32.ne
                br_if 0 (;@6;)
                local.get 6
                i32.const 2064
                i32.add
                local.get 4
                i32.store8
                i32.const 0
                local.set 5
                i32.const 0
                local.get 6
                i32.const 1
                i32.add
                local.tee 6
                i32.store offset=2052
                i32.const 0
                local.set 4
                br 1 (;@5;)
              end
              local.get 5
              i32.const 1
              i32.add
              local.set 5
            end
            local.get 1
            i32.const -1
            i32.add
            i32.const 7
            local.get 8
            select
            local.set 1
            local.get 3
            local.get 9
            i32.sub
            local.set 3
            local.get 2
            local.get 7
            i32.const 1
            i32.add
            local.tee 7
            i32.const 255
            i32.and
            i32.ge_u
            br_if 0 (;@4;)
          end
          i32.const 0
          local.get 4
          i32.store8 offset=3088
          i32.const 0
          local.get 5
          i32.store8 offset=3089
          br 1 (;@2;)
        end
        i32.const 0
        i32.load8_u offset=3089
        local.set 5
      end
      local.get 5
      i32.const 255
      i32.and
      local.tee 1
      i32.eqz
      br_if 0 (;@1;)
      i32.const 0
      i32.const 0
      i32.load offset=2052
      local.tee 3
      i32.const 1
      i32.add
      i32.store offset=2052
      local.get 3
      i32.const 2064
      i32.add
      i32.const 0
      i32.load8_u offset=3088
      i32.const 8
      local.get 1
      i32.sub
      i32.shl
      i32.store8
    end
    local.get 0
    i32.const 17536
    i32.add
    global.set $__stack_pointer)
  (func $__original_main (type 5) (result i32)
    (local i32 i32 i32)
    i32.const 0
    local.set 0
    i32.const 0
    i32.const 0
    i32.store offset=2052
    i32.const 0
    i32.const 0
    i32.store offset=2048
    call $huff_enc_main
    i32.const 419
    i32.const 419
    call $__pragma_loopbound
    block  ;; label = @1
      block  ;; label = @2
        block  ;; label = @3
          block  ;; label = @4
            loop  ;; label = @5
              local.get 0
              i32.const 1024
              i32.add
              i32.load8_u
              local.get 0
              i32.const 2064
              i32.add
              i32.load8_u
              i32.ne
              br_if 1 (;@4;)
              local.get 0
              i32.const 1025
              i32.add
              i32.load8_u
              local.get 0
              i32.const 2065
              i32.add
              i32.load8_u
              i32.ne
              br_if 2 (;@3;)
              local.get 0
              i32.const 1026
              i32.add
              i32.load8_u
              local.get 0
              i32.const 2066
              i32.add
              i32.load8_u
              i32.ne
              br_if 3 (;@2;)
              block  ;; label = @6
                local.get 0
                i32.const 416
                i32.ne
                br_if 0 (;@6;)
                i32.const 0
                return
              end
              local.get 0
              i32.const 2067
              i32.add
              local.set 1
              local.get 0
              i32.const 1027
              i32.add
              local.set 2
              local.get 0
              i32.const 4
              i32.add
              local.set 0
              local.get 2
              i32.load8_u
              local.get 1
              i32.load8_u
              i32.eq
              br_if 0 (;@5;)
              br 4 (;@1;)
            end
          end
          local.get 0
          i32.const 1
          i32.add
          return
        end
        local.get 0
        i32.const 2
        i32.add
        return
      end
      local.get 0
      i32.const 3
      i32.add
      local.set 0
    end
    local.get 0)
  (table (;0;) 1 1 funcref)
  (memory (;0;) 1)
  (global $__stack_pointer (mut i32) (i32.const 7200))
  (global (;1;) i32 (i32.const 3090))
  (global (;2;) i32 (i32.const 7200))
  (export "memory" (memory 0))
  (export "__wasm_apply_data_relocs" (func $__wasm_apply_data_relocs))
  (export "entrypoint" (func $huff_enc_main))
  (export "main" (func $__original_main))
  (export "__data_end" (global 1))
  (export "__heap_base" (global 2))
  (data $.rodata (i32.const 1024) "\80\00\00\00P\85  \80d\04 ?\ef\ff\f0\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\04\07\a7\15\81\e8Ex\84\d9\14\a2\13\a4'\85\fc\8ai\14\c2\13\81\f0\ac\8a\f8\96\0b\0b\f0\c9D@r5\11*%\c3\80\d4t\c2)b43\0c\84p\f4\03$!4'\87\a4!>\9cW\0en\16W2U\c6c\8e\8c\c2QN\9eT\81\fe\81\f8n\b3\9f\c0\91\85\b8\b8\1c\d2`\92I\0a\e2\15S\98J\0do\84\c7\ca\db\f1J\c1\a7i\de\1f\93\067\1f\81(\e84\99\a0\94\12$\c5-\d8\caV\1e\1f\b1Z\85\8a\f8\17Q\c3\a0d\d7]2\b9\e1\fb\17\06\e6\e1\e5pGP`\8d\cd\b0\e6U\c4\09\18]Zy\e1LD\98?\19k\8ce\cc\d6M\1a\c2`\120M\d2\89\01\fd\04\e6\f88\f0\e0o\a3_\0a\0c\df\07\ea\a7\81($`\87}\f5\fa\02\c6x\7f\00\91\85\d5\a7\87\95\c3C\ebl\09\18W\11f\98%\04\de\83\bc\90I$\80I\14Q\98\b1\85\f8\1c\a5\83x\7f\f0\f2\b8h}m\81#\1e\04\91A\caX\09\8ag,\cdd\a7\18\98\0b\183%B\09\18\1f\ae\ca\d41\98\12`\9b\d0w\92-a08\1c\c2Z\e0\cc\90\e8\b0$`~\bb+S\0cy\81\d1`\c5#\026\b0\f9\5c\d0\cc\91\bc)\aa\b4G\10$`~\bb+S\13\00\91\81d\d1\0f+\877\06\ee\b4\c2Z\11\e5s\15\a8\fb\8c\83\a2\d9\a6]\16\04\8c\1f[\a67\19\ca\c0o\14\ab\cf'\c0You are doubtless asking \22How can I reduce the data size without losing some informations?\22. It's easy to answer to this question. I'll only take an example. I'm sure you have heard about the morse. This system established in the 19th century use a scheme very close to the huffman one. In the morse you encode the letters to transmit with two kinds of signs. If you encode these two sign possibilities in one bit, the symbol 'e' is transmitted in a single bit and the symbols 'y' and 'z' need four bits. Look at the symbols in the text you are reading, you'll fast understand the compression ratio...\00"))
