diff options
-rw-r--r-- | test/passes/reverse_dwarf_abbrevs.bin.txt | 2374 | ||||
-rw-r--r-- | test/passes/reverse_dwarf_abbrevs.passes | 1 | ||||
-rw-r--r-- | test/passes/reverse_dwarf_abbrevs.wasm | bin | 0 -> 2790 bytes | |||
-rw-r--r-- | third_party/llvm-project/DWARFVisitor.cpp | 12 |
4 files changed, 2381 insertions, 6 deletions
diff --git a/test/passes/reverse_dwarf_abbrevs.bin.txt b/test/passes/reverse_dwarf_abbrevs.bin.txt new file mode 100644 index 000000000..0b021420d --- /dev/null +++ b/test/passes/reverse_dwarf_abbrevs.bin.txt @@ -0,0 +1,2374 @@ +DWARF debug info +================ + +Contains section .debug_info (79 bytes) +Contains section .debug_abbrev (64 bytes) +Contains section .debug_line (53 bytes) +Contains section .debug_str (206 bytes) + +.debug_abbrev contents: +Abbrev table for offset: 0x00000000 +[1] DW_TAG_base_type DW_CHILDREN_no + DW_AT_name DW_FORM_strp + DW_AT_encoding DW_FORM_data1 + DW_AT_byte_size DW_FORM_data1 + +[2] DW_TAG_GNU_call_site DW_CHILDREN_no + DW_AT_low_pc DW_FORM_addr + +[3] DW_TAG_subprogram DW_CHILDREN_yes + DW_AT_low_pc DW_FORM_addr + DW_AT_high_pc DW_FORM_data4 + DW_AT_frame_base DW_FORM_exprloc + DW_AT_GNU_all_call_sites DW_FORM_flag_present + DW_AT_name DW_FORM_strp + DW_AT_decl_file DW_FORM_data1 + DW_AT_decl_line DW_FORM_data1 + DW_AT_type DW_FORM_ref4 + DW_AT_external DW_FORM_flag_present + +[4] DW_TAG_compile_unit DW_CHILDREN_yes + DW_AT_producer DW_FORM_strp + DW_AT_language DW_FORM_data2 + DW_AT_name DW_FORM_strp + DW_AT_stmt_list DW_FORM_sec_offset + DW_AT_comp_dir DW_FORM_strp + DW_AT_low_pc DW_FORM_addr + DW_AT_high_pc DW_FORM_data4 + + +.debug_info contents: +0x00000000: Compile Unit: length = 0x0000004b version = 0x0004 abbr_offset = 0x0000 addr_size = 0x04 (next unit at 0x0000004f) + +0x0000000b: DW_TAG_compile_unit [4] * + DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000000] = "clang version 12.0.0 (/b/s/w/ir/cache/git/chromium.googlesource.com-external-github.com-llvm-llvm--project 576bd52f778405de08f309678e4fe4f7523bf7c4)") + DW_AT_language [DW_FORM_data2] (DW_LANG_C99) + DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000095] = "tests/hello_world.c") + DW_AT_stmt_list [DW_FORM_sec_offset] (0x00000000) + DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x000000a9] = "/home/azakai/Dev/emscripten") + DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000) + DW_AT_high_pc [DW_FORM_data4] (0x00000000) + +0x00000026: DW_TAG_subprogram [3] * + DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000) + DW_AT_high_pc [DW_FORM_data4] (0x00000000) + DW_AT_frame_base [DW_FORM_exprloc] (DW_OP_WASM_location 0x3 +0, <decoding error> 00 00 9f) + DW_AT_GNU_all_call_sites [DW_FORM_flag_present] (true) + DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000c5] = "main") + DW_AT_decl_file [DW_FORM_data1] ("/home/azakai/Dev/emscripten/tests/hello_world.c") + DW_AT_decl_line [DW_FORM_data1] (10) + DW_AT_type [DW_FORM_ref4] (cu + 0x0047 => {0x00000047} "int") + DW_AT_external [DW_FORM_flag_present] (true) + +0x00000041: DW_TAG_GNU_call_site [2] + DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000) + +0x00000046: NULL + +0x00000047: DW_TAG_base_type [1] + DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000ca] = "int") + DW_AT_encoding [DW_FORM_data1] (DW_ATE_signed) + DW_AT_byte_size [DW_FORM_data1] (0x04) + +0x0000004e: NULL + +.debug_line contents: +debug_line[0x00000000] +Line table prologue: + total_length: 0x00000031 + version: 4 + prologue_length: 0x0000002b + min_inst_length: 1 +max_ops_per_inst: 1 + default_is_stmt: 1 + line_base: -5 + line_range: 14 + opcode_base: 13 +standard_opcode_lengths[DW_LNS_copy] = 0 +standard_opcode_lengths[DW_LNS_advance_pc] = 1 +standard_opcode_lengths[DW_LNS_advance_line] = 1 +standard_opcode_lengths[DW_LNS_set_file] = 1 +standard_opcode_lengths[DW_LNS_set_column] = 1 +standard_opcode_lengths[DW_LNS_negate_stmt] = 0 +standard_opcode_lengths[DW_LNS_set_basic_block] = 0 +standard_opcode_lengths[DW_LNS_const_add_pc] = 0 +standard_opcode_lengths[DW_LNS_fixed_advance_pc] = 1 +standard_opcode_lengths[DW_LNS_set_prologue_end] = 0 +standard_opcode_lengths[DW_LNS_set_epilogue_begin] = 0 +standard_opcode_lengths[DW_LNS_set_isa] = 1 +include_directories[ 1] = "tests" +file_names[ 1]: + name: "hello_world.c" + dir_index: 1 + mod_time: 0x00000000 + length: 0x00000000 + +.debug_str contents: +0x00000000: "clang version 12.0.0 (/b/s/w/ir/cache/git/chromium.googlesource.com-external-github.com-llvm-llvm--project 576bd52f778405de08f309678e4fe4f7523bf7c4)" +0x00000095: "tests/hello_world.c" +0x000000a9: "/home/azakai/Dev/emscripten" +0x000000c5: "main" +0x000000ca: "int" +(module + (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_=>_none (func (param i32))) + (type $none_=>_i32 (func (result i32))) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) + (type $i32_i64_i32_=>_i64 (func (param i32 i64 i32) (result i64))) + (type $none_=>_none (func)) + (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) + (type $i32_i32_i64_i32_=>_i64 (func (param i32 i32 i64 i32) (result i64))) + (import "env" "memory" (memory $3 256 256)) + (data (i32.const 1024) "hello, world!\00\00\00\18\04") + (data (i32.const 1048) "\05") + (data (i32.const 1060) "\01") + (data (i32.const 1084) "\02\00\00\00\03\00\00\00\c8\04\00\00\00\04") + (data (i32.const 1108) "\01") + (data (i32.const 1123) "\n\ff\ff\ff\ff") + (import "env" "__indirect_function_table" (table $timport$4 4 funcref)) + (elem (i32.const 1) $6 $5 $7) + (import "wasi_snapshot_preview1" "fd_write" (func $fimport$0 (param i32 i32 i32 i32) (result i32))) + (import "env" "emscripten_memcpy_big" (func $fimport$1 (param i32 i32 i32) (result i32))) + (import "env" "setTempRet0" (func $fimport$2 (param i32))) + (global $global$0 (mut i32) (i32.const 5245136)) + (global $global$1 i32 (i32.const 2248)) + (export "__wasm_call_ctors" (func $0)) + (export "main" (func $2)) + (export "__errno_location" (func $3)) + (export "stackSave" (func $18)) + (export "stackRestore" (func $19)) + (export "stackAlloc" (func $20)) + (export "__data_end" (global $global$1)) + (export "dynCall_jiji" (func $22)) + (export "__growWasmMemory" (func $23)) + (func $0 + ;; code offset: 0x3 + (nop) + ) + (func $1 (result i32) + ;; code offset: 0xc + (drop + ;; code offset: 0xa + (call $14 + ;; code offset: 0x7 + (i32.const 1024) + ) + ) + ;; code offset: 0xd + (i32.const 0) + ) + (func $2 (param $0 i32) (param $1 i32) (result i32) + ;; code offset: 0x12 + (call $1) + ) + (func $3 (result i32) + ;; code offset: 0x17 + (i32.const 1200) + ) + (func $4 (param $0 i32) (result i32) + ;; code offset: 0x20 + (if + ;; code offset: 0x1f + (i32.eqz + ;; code offset: 0x1d + (local.get $0) + ) + ;; code offset: 0x24 + (return + ;; code offset: 0x22 + (i32.const 0) + ) + ) + ;; code offset: 0x2a + (i32.store + ;; code offset: 0x26 + (call $3) + ;; code offset: 0x28 + (local.get $0) + ) + ;; code offset: 0x2d + (i32.const -1) + ) + (func $5 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + ;; code offset: 0x48 + (global.set $global$0 + ;; code offset: 0x46 + (local.tee $3 + ;; code offset: 0x45 + (i32.sub + ;; code offset: 0x41 + (global.get $global$0) + ;; code offset: 0x43 + (i32.const 32) + ) + ) + ) + ;; code offset: 0x53 + (i32.store offset=16 + ;; code offset: 0x4a + (local.get $3) + ;; code offset: 0x51 + (local.tee $4 + ;; code offset: 0x4e + (i32.load offset=28 + ;; code offset: 0x4c + (local.get $0) + ) + ) + ) + ;; code offset: 0x5b + (local.set $5 + ;; code offset: 0x58 + (i32.load offset=20 + ;; code offset: 0x56 + (local.get $0) + ) + ) + ;; code offset: 0x61 + (i32.store offset=28 + ;; code offset: 0x5d + (local.get $3) + ;; code offset: 0x5f + (local.get $2) + ) + ;; code offset: 0x68 + (i32.store offset=24 + ;; code offset: 0x64 + (local.get $3) + ;; code offset: 0x66 + (local.get $1) + ) + ;; code offset: 0x74 + (i32.store offset=20 + ;; code offset: 0x6b + (local.get $3) + ;; code offset: 0x72 + (local.tee $1 + ;; code offset: 0x71 + (i32.sub + ;; code offset: 0x6d + (local.get $5) + ;; code offset: 0x6f + (local.get $4) + ) + ) + ) + ;; code offset: 0x7c + (local.set $6 + ;; code offset: 0x7b + (i32.add + ;; code offset: 0x77 + (local.get $1) + ;; code offset: 0x79 + (local.get $2) + ) + ) + ;; code offset: 0x80 + (local.set $7 + ;; code offset: 0x7e + (i32.const 2) + ) + ;; code offset: 0x87 + (local.set $1 + ;; code offset: 0x86 + (i32.add + ;; code offset: 0x82 + (local.get $3) + ;; code offset: 0x84 + (i32.const 16) + ) + ) + ;; code offset: 0x18d + (local.set $4 + ;; code offset: 0x89 + (block $label$1 (result i32) + (block $label$2 + (block $label$3 + ;; code offset: 0xa5 + (if + ;; code offset: 0xa4 + (i32.eqz + ;; code offset: 0xa2 + (call $4 + ;; code offset: 0xa0 + (call $fimport$0 + ;; code offset: 0x91 + (i32.load offset=60 + ;; code offset: 0x8f + (local.get $0) + ) + ;; code offset: 0x98 + (i32.add + ;; code offset: 0x94 + (local.get $3) + ;; code offset: 0x96 + (i32.const 16) + ) + ;; code offset: 0x99 + (i32.const 2) + ;; code offset: 0x9f + (i32.add + ;; code offset: 0x9b + (local.get $3) + ;; code offset: 0x9d + (i32.const 12) + ) + ) + ) + ) + ;; code offset: 0xa7 + (loop $label$5 + ;; code offset: 0xb3 + (br_if $label$3 + ;; code offset: 0xb2 + (i32.eq + ;; code offset: 0xa9 + (local.get $6) + ;; code offset: 0xb0 + (local.tee $4 + ;; code offset: 0xad + (i32.load offset=12 + ;; code offset: 0xab + (local.get $3) + ) + ) + ) + ) + ;; code offset: 0xba + (br_if $label$2 + ;; code offset: 0xb9 + (i32.le_s + ;; code offset: 0xb5 + (local.get $4) + ;; code offset: 0xb7 + (i32.const -1) + ) + ) + ;; code offset: 0xe2 + (i32.store + ;; code offset: 0xce + (local.tee $9 + ;; code offset: 0xcd + (i32.add + ;; code offset: 0xbc + (local.get $1) + ;; code offset: 0xcc + (i32.shl + ;; code offset: 0xc8 + (local.tee $5 + ;; code offset: 0xc7 + (i32.gt_u + ;; code offset: 0xbe + (local.get $4) + ;; code offset: 0xc5 + (local.tee $8 + ;; code offset: 0xc2 + (i32.load offset=4 + ;; code offset: 0xc0 + (local.get $1) + ) + ) + ) + ) + ;; code offset: 0xca + (i32.const 3) + ) + ) + ) + ;; code offset: 0xe1 + (i32.add + ;; code offset: 0xda + (local.tee $8 + ;; code offset: 0xd9 + (i32.sub + ;; code offset: 0xd0 + (local.get $4) + ;; code offset: 0xd8 + (select + ;; code offset: 0xd2 + (local.get $8) + ;; code offset: 0xd4 + (i32.const 0) + ;; code offset: 0xd6 + (local.get $5) + ) + ) + ) + ;; code offset: 0xde + (i32.load + ;; code offset: 0xdc + (local.get $9) + ) + ) + ) + ;; code offset: 0xf9 + (i32.store + ;; code offset: 0xef + (local.tee $9 + ;; code offset: 0xee + (i32.add + ;; code offset: 0xe5 + (local.get $1) + ;; code offset: 0xed + (select + ;; code offset: 0xe7 + (i32.const 12) + ;; code offset: 0xe9 + (i32.const 4) + ;; code offset: 0xeb + (local.get $5) + ) + ) + ) + ;; code offset: 0xf8 + (i32.sub + ;; code offset: 0xf3 + (i32.load + ;; code offset: 0xf1 + (local.get $9) + ) + ;; code offset: 0xf6 + (local.get $8) + ) + ) + ;; code offset: 0x101 + (local.set $6 + ;; code offset: 0x100 + (i32.sub + ;; code offset: 0xfc + (local.get $6) + ;; code offset: 0xfe + (local.get $4) + ) + ) + ;; code offset: 0x125 + (br_if $label$5 + ;; code offset: 0x124 + (i32.eqz + ;; code offset: 0x122 + (call $4 + ;; code offset: 0x120 + (call $fimport$0 + ;; code offset: 0x105 + (i32.load offset=60 + ;; code offset: 0x103 + (local.get $0) + ) + ;; code offset: 0x112 + (local.tee $1 + ;; code offset: 0x111 + (select + ;; code offset: 0x10c + (i32.add + ;; code offset: 0x108 + (local.get $1) + ;; code offset: 0x10a + (i32.const 8) + ) + ;; code offset: 0x10d + (local.get $1) + ;; code offset: 0x10f + (local.get $5) + ) + ) + ;; code offset: 0x119 + (local.tee $7 + ;; code offset: 0x118 + (i32.sub + ;; code offset: 0x114 + (local.get $7) + ;; code offset: 0x116 + (local.get $5) + ) + ) + ;; code offset: 0x11f + (i32.add + ;; code offset: 0x11b + (local.get $3) + ;; code offset: 0x11d + (i32.const 12) + ) + ) + ) + ) + ) + ) + ) + ;; code offset: 0x12d + (i32.store offset=12 + ;; code offset: 0x129 + (local.get $3) + ;; code offset: 0x12b + (i32.const -1) + ) + ;; code offset: 0x135 + (br_if $label$2 + ;; code offset: 0x134 + (i32.ne + ;; code offset: 0x130 + (local.get $6) + ;; code offset: 0x132 + (i32.const -1) + ) + ) + ) + ;; code offset: 0x141 + (i32.store offset=28 + ;; code offset: 0x138 + (local.get $0) + ;; code offset: 0x13f + (local.tee $1 + ;; code offset: 0x13c + (i32.load offset=44 + ;; code offset: 0x13a + (local.get $0) + ) + ) + ) + ;; code offset: 0x148 + (i32.store offset=20 + ;; code offset: 0x144 + (local.get $0) + ;; code offset: 0x146 + (local.get $1) + ) + ;; code offset: 0x155 + (i32.store offset=16 + ;; code offset: 0x14b + (local.get $0) + ;; code offset: 0x154 + (i32.add + ;; code offset: 0x14d + (local.get $1) + ;; code offset: 0x151 + (i32.load offset=48 + ;; code offset: 0x14f + (local.get $0) + ) + ) + ) + ;; code offset: 0x15a + (br $label$1 + ;; code offset: 0x158 + (local.get $2) + ) + ) + ;; code offset: 0x161 + (i32.store offset=28 + ;; code offset: 0x15d + (local.get $0) + ;; code offset: 0x15f + (i32.const 0) + ) + ;; code offset: 0x168 + (i64.store offset=16 + ;; code offset: 0x164 + (local.get $0) + ;; code offset: 0x166 + (i64.const 0) + ) + ;; code offset: 0x175 + (i32.store + ;; code offset: 0x16b + (local.get $0) + ;; code offset: 0x174 + (i32.or + ;; code offset: 0x16f + (i32.load + ;; code offset: 0x16d + (local.get $0) + ) + ;; code offset: 0x172 + (i32.const 32) + ) + ) + ;; code offset: 0x183 + (drop + ;; code offset: 0x181 + (br_if $label$1 + ;; code offset: 0x17a + (local.tee $4 + ;; code offset: 0x178 + (i32.const 0) + ) + ;; code offset: 0x180 + (i32.eq + ;; code offset: 0x17c + (local.get $7) + ;; code offset: 0x17e + (i32.const 2) + ) + ) + ) + ;; code offset: 0x18b + (i32.sub + ;; code offset: 0x184 + (local.get $2) + ;; code offset: 0x188 + (i32.load offset=4 + ;; code offset: 0x186 + (local.get $1) + ) + ) + ) + ) + ;; code offset: 0x194 + (global.set $global$0 + ;; code offset: 0x193 + (i32.add + ;; code offset: 0x18f + (local.get $3) + ;; code offset: 0x191 + (i32.const 32) + ) + ) + ;; code offset: 0x196 + (local.get $4) + ) + (func $6 (param $0 i32) (result i32) + ;; code offset: 0x19b + (i32.const 0) + ) + (func $7 (param $0 i32) (param $1 i64) (param $2 i32) (result i64) + ;; code offset: 0x1a0 + (i64.const 0) + ) + (func $8 (param $0 i32) (result i32) + (local $1 i32) + ;; code offset: 0x1b6 + (i32.store8 offset=74 + ;; code offset: 0x1a7 + (local.get $0) + ;; code offset: 0x1b5 + (i32.or + ;; code offset: 0x1b2 + (i32.add + ;; code offset: 0x1ae + (local.tee $1 + ;; code offset: 0x1ab + (i32.load8_u offset=74 + ;; code offset: 0x1a9 + (local.get $0) + ) + ) + ;; code offset: 0x1b0 + (i32.const -1) + ) + ;; code offset: 0x1b3 + (local.get $1) + ) + ) + ;; code offset: 0x1c3 + (if + ;; code offset: 0x1c2 + (i32.and + ;; code offset: 0x1be + (local.tee $1 + ;; code offset: 0x1bb + (i32.load + ;; code offset: 0x1b9 + (local.get $0) + ) + ) + ;; code offset: 0x1c0 + (i32.const 8) + ) + (block + ;; code offset: 0x1cc + (i32.store + ;; code offset: 0x1c5 + (local.get $0) + ;; code offset: 0x1cb + (i32.or + ;; code offset: 0x1c7 + (local.get $1) + ;; code offset: 0x1c9 + (i32.const 32) + ) + ) + ;; code offset: 0x1d1 + (return + ;; code offset: 0x1cf + (i32.const -1) + ) + ) + ) + ;; code offset: 0x1d7 + (i64.store offset=4 align=4 + ;; code offset: 0x1d3 + (local.get $0) + ;; code offset: 0x1d5 + (i64.const 0) + ) + ;; code offset: 0x1e3 + (i32.store offset=28 + ;; code offset: 0x1da + (local.get $0) + ;; code offset: 0x1e1 + (local.tee $1 + ;; code offset: 0x1de + (i32.load offset=44 + ;; code offset: 0x1dc + (local.get $0) + ) + ) + ) + ;; code offset: 0x1ea + (i32.store offset=20 + ;; code offset: 0x1e6 + (local.get $0) + ;; code offset: 0x1e8 + (local.get $1) + ) + ;; code offset: 0x1f7 + (i32.store offset=16 + ;; code offset: 0x1ed + (local.get $0) + ;; code offset: 0x1f6 + (i32.add + ;; code offset: 0x1ef + (local.get $1) + ;; code offset: 0x1f3 + (i32.load offset=48 + ;; code offset: 0x1f1 + (local.get $0) + ) + ) + ) + ;; code offset: 0x1fa + (i32.const 0) + ) + (func $9 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + ;; code offset: 0x20c + (if + ;; code offset: 0x20b + (i32.ge_u + ;; code offset: 0x206 + (local.get $2) + ;; code offset: 0x208 + (i32.const 512) + ) + (block + ;; code offset: 0x216 + (drop + ;; code offset: 0x214 + (call $fimport$1 + ;; code offset: 0x20e + (local.get $0) + ;; code offset: 0x210 + (local.get $1) + ;; code offset: 0x212 + (local.get $2) + ) + ) + ;; code offset: 0x219 + (return + ;; code offset: 0x217 + (local.get $0) + ) + ) + ) + ;; code offset: 0x220 + (local.set $3 + ;; code offset: 0x21f + (i32.add + ;; code offset: 0x21b + (local.get $0) + ;; code offset: 0x21d + (local.get $2) + ) + ) + ;; code offset: 0x222 + (block $label$2 + ;; code offset: 0x22d + (if + ;; code offset: 0x22c + (i32.eqz + ;; code offset: 0x22b + (i32.and + ;; code offset: 0x228 + (i32.xor + ;; code offset: 0x224 + (local.get $0) + ;; code offset: 0x226 + (local.get $1) + ) + ;; code offset: 0x229 + (i32.const 3) + ) + ) + (block + ;; code offset: 0x22f + (block $label$4 + ;; code offset: 0x236 + (if + ;; code offset: 0x235 + (i32.lt_s + ;; code offset: 0x231 + (local.get $2) + ;; code offset: 0x233 + (i32.const 1) + ) + (block + ;; code offset: 0x23a + (local.set $2 + ;; code offset: 0x238 + (local.get $0) + ) + ;; code offset: 0x23c + (br $label$4) + ) + ) + ;; code offset: 0x245 + (if + ;; code offset: 0x244 + (i32.eqz + ;; code offset: 0x243 + (i32.and + ;; code offset: 0x23f + (local.get $0) + ;; code offset: 0x241 + (i32.const 3) + ) + ) + (block + ;; code offset: 0x249 + (local.set $2 + ;; code offset: 0x247 + (local.get $0) + ) + ;; code offset: 0x24b + (br $label$4) + ) + ) + ;; code offset: 0x250 + (local.set $2 + ;; code offset: 0x24e + (local.get $0) + ) + ;; code offset: 0x252 + (loop $label$7 + ;; code offset: 0x25b + (i32.store8 + ;; code offset: 0x254 + (local.get $2) + ;; code offset: 0x258 + (i32.load8_u + ;; code offset: 0x256 + (local.get $1) + ) + ) + ;; code offset: 0x263 + (local.set $1 + ;; code offset: 0x262 + (i32.add + ;; code offset: 0x25e + (local.get $1) + ;; code offset: 0x260 + (i32.const 1) + ) + ) + ;; code offset: 0x26f + (br_if $label$4 + ;; code offset: 0x26e + (i32.ge_u + ;; code offset: 0x26a + (local.tee $2 + ;; code offset: 0x269 + (i32.add + ;; code offset: 0x265 + (local.get $2) + ;; code offset: 0x267 + (i32.const 1) + ) + ) + ;; code offset: 0x26c + (local.get $3) + ) + ) + ;; code offset: 0x276 + (br_if $label$7 + ;; code offset: 0x275 + (i32.and + ;; code offset: 0x271 + (local.get $2) + ;; code offset: 0x273 + (i32.const 3) + ) + ) + ) + ) + ;; code offset: 0x27a + (block $label$8 + ;; code offset: 0x287 + (br_if $label$8 + ;; code offset: 0x286 + (i32.lt_u + ;; code offset: 0x281 + (local.tee $4 + ;; code offset: 0x280 + (i32.and + ;; code offset: 0x27c + (local.get $3) + ;; code offset: 0x27e + (i32.const -4) + ) + ) + ;; code offset: 0x283 + (i32.const 64) + ) + ) + ;; code offset: 0x293 + (br_if $label$8 + ;; code offset: 0x292 + (i32.gt_u + ;; code offset: 0x289 + (local.get $2) + ;; code offset: 0x290 + (local.tee $5 + ;; code offset: 0x28f + (i32.add + ;; code offset: 0x28b + (local.get $4) + ;; code offset: 0x28d + (i32.const -64) + ) + ) + ) + ) + ;; code offset: 0x295 + (loop $label$9 + ;; code offset: 0x29e + (i32.store + ;; code offset: 0x297 + (local.get $2) + ;; code offset: 0x29b + (i32.load + ;; code offset: 0x299 + (local.get $1) + ) + ) + ;; code offset: 0x2a8 + (i32.store offset=4 + ;; code offset: 0x2a1 + (local.get $2) + ;; code offset: 0x2a5 + (i32.load offset=4 + ;; code offset: 0x2a3 + (local.get $1) + ) + ) + ;; code offset: 0x2b2 + (i32.store offset=8 + ;; code offset: 0x2ab + (local.get $2) + ;; code offset: 0x2af + (i32.load offset=8 + ;; code offset: 0x2ad + (local.get $1) + ) + ) + ;; code offset: 0x2bc + (i32.store offset=12 + ;; code offset: 0x2b5 + (local.get $2) + ;; code offset: 0x2b9 + (i32.load offset=12 + ;; code offset: 0x2b7 + (local.get $1) + ) + ) + ;; code offset: 0x2c6 + (i32.store offset=16 + ;; code offset: 0x2bf + (local.get $2) + ;; code offset: 0x2c3 + (i32.load offset=16 + ;; code offset: 0x2c1 + (local.get $1) + ) + ) + ;; code offset: 0x2d0 + (i32.store offset=20 + ;; code offset: 0x2c9 + (local.get $2) + ;; code offset: 0x2cd + (i32.load offset=20 + ;; code offset: 0x2cb + (local.get $1) + ) + ) + ;; code offset: 0x2da + (i32.store offset=24 + ;; code offset: 0x2d3 + (local.get $2) + ;; code offset: 0x2d7 + (i32.load offset=24 + ;; code offset: 0x2d5 + (local.get $1) + ) + ) + ;; code offset: 0x2e4 + (i32.store offset=28 + ;; code offset: 0x2dd + (local.get $2) + ;; code offset: 0x2e1 + (i32.load offset=28 + ;; code offset: 0x2df + (local.get $1) + ) + ) + ;; code offset: 0x2ee + (i32.store offset=32 + ;; code offset: 0x2e7 + (local.get $2) + ;; code offset: 0x2eb + (i32.load offset=32 + ;; code offset: 0x2e9 + (local.get $1) + ) + ) + ;; code offset: 0x2f8 + (i32.store offset=36 + ;; code offset: 0x2f1 + (local.get $2) + ;; code offset: 0x2f5 + (i32.load offset=36 + ;; code offset: 0x2f3 + (local.get $1) + ) + ) + ;; code offset: 0x302 + (i32.store offset=40 + ;; code offset: 0x2fb + (local.get $2) + ;; code offset: 0x2ff + (i32.load offset=40 + ;; code offset: 0x2fd + (local.get $1) + ) + ) + ;; code offset: 0x30c + (i32.store offset=44 + ;; code offset: 0x305 + (local.get $2) + ;; code offset: 0x309 + (i32.load offset=44 + ;; code offset: 0x307 + (local.get $1) + ) + ) + ;; code offset: 0x316 + (i32.store offset=48 + ;; code offset: 0x30f + (local.get $2) + ;; code offset: 0x313 + (i32.load offset=48 + ;; code offset: 0x311 + (local.get $1) + ) + ) + ;; code offset: 0x320 + (i32.store offset=52 + ;; code offset: 0x319 + (local.get $2) + ;; code offset: 0x31d + (i32.load offset=52 + ;; code offset: 0x31b + (local.get $1) + ) + ) + ;; code offset: 0x32a + (i32.store offset=56 + ;; code offset: 0x323 + (local.get $2) + ;; code offset: 0x327 + (i32.load offset=56 + ;; code offset: 0x325 + (local.get $1) + ) + ) + ;; code offset: 0x334 + (i32.store offset=60 + ;; code offset: 0x32d + (local.get $2) + ;; code offset: 0x331 + (i32.load offset=60 + ;; code offset: 0x32f + (local.get $1) + ) + ) + ;; code offset: 0x33c + (local.set $1 + ;; code offset: 0x33b + (i32.sub + ;; code offset: 0x337 + (local.get $1) + ;; code offset: 0x339 + (i32.const -64) + ) + ) + ;; code offset: 0x348 + (br_if $label$9 + ;; code offset: 0x347 + (i32.le_u + ;; code offset: 0x343 + (local.tee $2 + ;; code offset: 0x342 + (i32.sub + ;; code offset: 0x33e + (local.get $2) + ;; code offset: 0x340 + (i32.const -64) + ) + ) + ;; code offset: 0x345 + (local.get $5) + ) + ) + ) + ) + ;; code offset: 0x351 + (br_if $label$2 + ;; code offset: 0x350 + (i32.ge_u + ;; code offset: 0x34c + (local.get $2) + ;; code offset: 0x34e + (local.get $4) + ) + ) + ;; code offset: 0x353 + (loop $label$10 + ;; code offset: 0x35c + (i32.store + ;; code offset: 0x355 + (local.get $2) + ;; code offset: 0x359 + (i32.load + ;; code offset: 0x357 + (local.get $1) + ) + ) + ;; code offset: 0x364 + (local.set $1 + ;; code offset: 0x363 + (i32.add + ;; code offset: 0x35f + (local.get $1) + ;; code offset: 0x361 + (i32.const 4) + ) + ) + ;; code offset: 0x370 + (br_if $label$10 + ;; code offset: 0x36f + (i32.lt_u + ;; code offset: 0x36b + (local.tee $2 + ;; code offset: 0x36a + (i32.add + ;; code offset: 0x366 + (local.get $2) + ;; code offset: 0x368 + (i32.const 4) + ) + ) + ;; code offset: 0x36d + (local.get $4) + ) + ) + ) + ;; code offset: 0x373 + (br $label$2) + ) + ) + ;; code offset: 0x37b + (if + ;; code offset: 0x37a + (i32.lt_u + ;; code offset: 0x376 + (local.get $3) + ;; code offset: 0x378 + (i32.const 4) + ) + (block + ;; code offset: 0x37f + (local.set $2 + ;; code offset: 0x37d + (local.get $0) + ) + ;; code offset: 0x381 + (br $label$2) + ) + ) + ;; code offset: 0x38e + (if + ;; code offset: 0x38d + (i32.lt_u + ;; code offset: 0x389 + (local.tee $4 + ;; code offset: 0x388 + (i32.add + ;; code offset: 0x384 + (local.get $3) + ;; code offset: 0x386 + (i32.const -4) + ) + ) + ;; code offset: 0x38b + (local.get $0) + ) + (block + ;; code offset: 0x392 + (local.set $2 + ;; code offset: 0x390 + (local.get $0) + ) + ;; code offset: 0x394 + (br $label$2) + ) + ) + ;; code offset: 0x399 + (local.set $2 + ;; code offset: 0x397 + (local.get $0) + ) + ;; code offset: 0x39b + (loop $label$13 + ;; code offset: 0x3a4 + (i32.store8 + ;; code offset: 0x39d + (local.get $2) + ;; code offset: 0x3a1 + (i32.load8_u + ;; code offset: 0x39f + (local.get $1) + ) + ) + ;; code offset: 0x3ae + (i32.store8 offset=1 + ;; code offset: 0x3a7 + (local.get $2) + ;; code offset: 0x3ab + (i32.load8_u offset=1 + ;; code offset: 0x3a9 + (local.get $1) + ) + ) + ;; code offset: 0x3b8 + (i32.store8 offset=2 + ;; code offset: 0x3b1 + (local.get $2) + ;; code offset: 0x3b5 + (i32.load8_u offset=2 + ;; code offset: 0x3b3 + (local.get $1) + ) + ) + ;; code offset: 0x3c2 + (i32.store8 offset=3 + ;; code offset: 0x3bb + (local.get $2) + ;; code offset: 0x3bf + (i32.load8_u offset=3 + ;; code offset: 0x3bd + (local.get $1) + ) + ) + ;; code offset: 0x3ca + (local.set $1 + ;; code offset: 0x3c9 + (i32.add + ;; code offset: 0x3c5 + (local.get $1) + ;; code offset: 0x3c7 + (i32.const 4) + ) + ) + ;; code offset: 0x3d6 + (br_if $label$13 + ;; code offset: 0x3d5 + (i32.le_u + ;; code offset: 0x3d1 + (local.tee $2 + ;; code offset: 0x3d0 + (i32.add + ;; code offset: 0x3cc + (local.get $2) + ;; code offset: 0x3ce + (i32.const 4) + ) + ) + ;; code offset: 0x3d3 + (local.get $4) + ) + ) + ) + ) + ;; code offset: 0x3df + (if + ;; code offset: 0x3de + (i32.lt_u + ;; code offset: 0x3da + (local.get $2) + ;; code offset: 0x3dc + (local.get $3) + ) + ;; code offset: 0x3e1 + (loop $label$15 + ;; code offset: 0x3ea + (i32.store8 + ;; code offset: 0x3e3 + (local.get $2) + ;; code offset: 0x3e7 + (i32.load8_u + ;; code offset: 0x3e5 + (local.get $1) + ) + ) + ;; code offset: 0x3f2 + (local.set $1 + ;; code offset: 0x3f1 + (i32.add + ;; code offset: 0x3ed + (local.get $1) + ;; code offset: 0x3ef + (i32.const 1) + ) + ) + ;; code offset: 0x3fe + (br_if $label$15 + ;; code offset: 0x3fd + (i32.ne + ;; code offset: 0x3f9 + (local.tee $2 + ;; code offset: 0x3f8 + (i32.add + ;; code offset: 0x3f4 + (local.get $2) + ;; code offset: 0x3f6 + (i32.const 1) + ) + ) + ;; code offset: 0x3fb + (local.get $3) + ) + ) + ) + ) + ;; code offset: 0x402 + (local.get $0) + ) + (func $10 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + ;; code offset: 0x410 + (block $label$1 + ;; code offset: 0x43a + (if + (block $label$2 (result i32) + ;; code offset: 0x41c + (if + ;; code offset: 0x41b + (i32.eqz + ;; code offset: 0x419 + (local.tee $3 + ;; code offset: 0x416 + (i32.load offset=16 + ;; code offset: 0x414 + (local.get $2) + ) + ) + ) + (block + ;; code offset: 0x422 + (br_if $label$1 + ;; code offset: 0x420 + (call $8 + ;; code offset: 0x41e + (local.get $2) + ) + ) + ;; code offset: 0x429 + (local.set $3 + ;; code offset: 0x426 + (i32.load offset=16 + ;; code offset: 0x424 + (local.get $2) + ) + ) + ) + ) + ;; code offset: 0x438 + (i32.lt_u + ;; code offset: 0x435 + (i32.sub + ;; code offset: 0x42c + (local.get $3) + ;; code offset: 0x433 + (local.tee $5 + ;; code offset: 0x430 + (i32.load offset=20 + ;; code offset: 0x42e + (local.get $2) + ) + ) + ) + ;; code offset: 0x436 + (local.get $1) + ) + ) + ;; code offset: 0x44a + (return + ;; code offset: 0x447 + (call_indirect (type $i32_i32_i32_=>_i32) + ;; code offset: 0x43c + (local.get $2) + ;; code offset: 0x43e + (local.get $0) + ;; code offset: 0x440 + (local.get $1) + ;; code offset: 0x444 + (i32.load offset=36 + ;; code offset: 0x442 + (local.get $2) + ) + ) + ) + ) + ;; code offset: 0x44c + (block $label$5 + ;; code offset: 0x456 + (br_if $label$5 + ;; code offset: 0x455 + (i32.lt_s + ;; code offset: 0x450 + (i32.load8_s offset=75 + ;; code offset: 0x44e + (local.get $2) + ) + ;; code offset: 0x453 + (i32.const 0) + ) + ) + ;; code offset: 0x45a + (local.set $4 + ;; code offset: 0x458 + (local.get $1) + ) + ;; code offset: 0x45c + (loop $label$6 + ;; code offset: 0x463 + (br_if $label$5 + ;; code offset: 0x462 + (i32.eqz + ;; code offset: 0x460 + (local.tee $3 + ;; code offset: 0x45e + (local.get $4) + ) + ) + ) + ;; code offset: 0x475 + (br_if $label$6 + ;; code offset: 0x474 + (i32.ne + ;; code offset: 0x46f + (i32.load8_u + ;; code offset: 0x46e + (i32.add + ;; code offset: 0x465 + (local.get $0) + ;; code offset: 0x46c + (local.tee $4 + ;; code offset: 0x46b + (i32.add + ;; code offset: 0x467 + (local.get $3) + ;; code offset: 0x469 + (i32.const -1) + ) + ) + ) + ) + ;; code offset: 0x472 + (i32.const 10) + ) + ) + ) + ;; code offset: 0x48b + (br_if $label$1 + ;; code offset: 0x48a + (i32.lt_u + ;; code offset: 0x486 + (local.tee $4 + ;; code offset: 0x483 + (call_indirect (type $i32_i32_i32_=>_i32) + ;; code offset: 0x478 + (local.get $2) + ;; code offset: 0x47a + (local.get $0) + ;; code offset: 0x47c + (local.get $3) + ;; code offset: 0x480 + (i32.load offset=36 + ;; code offset: 0x47e + (local.get $2) + ) + ) + ) + ;; code offset: 0x488 + (local.get $3) + ) + ) + ;; code offset: 0x492 + (local.set $0 + ;; code offset: 0x491 + (i32.add + ;; code offset: 0x48d + (local.get $0) + ;; code offset: 0x48f + (local.get $3) + ) + ) + ;; code offset: 0x499 + (local.set $1 + ;; code offset: 0x498 + (i32.sub + ;; code offset: 0x494 + (local.get $1) + ;; code offset: 0x496 + (local.get $3) + ) + ) + ;; code offset: 0x4a0 + (local.set $5 + ;; code offset: 0x49d + (i32.load offset=20 + ;; code offset: 0x49b + (local.get $2) + ) + ) + ;; code offset: 0x4a4 + (local.set $6 + ;; code offset: 0x4a2 + (local.get $3) + ) + ) + ;; code offset: 0x4af + (drop + ;; code offset: 0x4ad + (call $9 + ;; code offset: 0x4a7 + (local.get $5) + ;; code offset: 0x4a9 + (local.get $0) + ;; code offset: 0x4ab + (local.get $1) + ) + ) + ;; code offset: 0x4ba + (i32.store offset=20 + ;; code offset: 0x4b0 + (local.get $2) + ;; code offset: 0x4b9 + (i32.add + ;; code offset: 0x4b4 + (i32.load offset=20 + ;; code offset: 0x4b2 + (local.get $2) + ) + ;; code offset: 0x4b7 + (local.get $1) + ) + ) + ;; code offset: 0x4c2 + (local.set $4 + ;; code offset: 0x4c1 + (i32.add + ;; code offset: 0x4bd + (local.get $1) + ;; code offset: 0x4bf + (local.get $6) + ) + ) + ) + ;; code offset: 0x4c5 + (local.get $4) + ) + (func $11 (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + (local $5 i32) + ;; code offset: 0x4d3 + (local.set $4 + ;; code offset: 0x4d2 + (i32.mul + ;; code offset: 0x4ce + (local.get $1) + ;; code offset: 0x4d0 + (local.get $2) + ) + ) + ;; code offset: 0x4d5 + (block $label$1 + ;; code offset: 0x4df + (if + ;; code offset: 0x4de + (i32.le_s + ;; code offset: 0x4d9 + (i32.load offset=76 + ;; code offset: 0x4d7 + (local.get $3) + ) + ;; code offset: 0x4dc + (i32.const -1) + ) + (block + ;; code offset: 0x4e9 + (local.set $0 + ;; code offset: 0x4e7 + (call $10 + ;; code offset: 0x4e1 + (local.get $0) + ;; code offset: 0x4e3 + (local.get $4) + ;; code offset: 0x4e5 + (local.get $3) + ) + ) + ;; code offset: 0x4eb + (br $label$1) + ) + ) + ;; code offset: 0x4f2 + (local.set $5 + ;; code offset: 0x4f0 + (call $15 + ;; code offset: 0x4ee + (local.get $3) + ) + ) + ;; code offset: 0x4fc + (local.set $0 + ;; code offset: 0x4fa + (call $10 + ;; code offset: 0x4f4 + (local.get $0) + ;; code offset: 0x4f6 + (local.get $4) + ;; code offset: 0x4f8 + (local.get $3) + ) + ) + ;; code offset: 0x501 + (br_if $label$1 + ;; code offset: 0x500 + (i32.eqz + ;; code offset: 0x4fe + (local.get $5) + ) + ) + ;; code offset: 0x505 + (call $16 + ;; code offset: 0x503 + (local.get $3) + ) + ) + ;; code offset: 0x50d + (if + ;; code offset: 0x50c + (i32.eq + ;; code offset: 0x508 + (local.get $0) + ;; code offset: 0x50a + (local.get $4) + ) + ;; code offset: 0x516 + (return + ;; code offset: 0x515 + (select + ;; code offset: 0x50f + (local.get $2) + ;; code offset: 0x511 + (i32.const 0) + ;; code offset: 0x513 + (local.get $1) + ) + ) + ) + ;; code offset: 0x51c + (i32.div_u + ;; code offset: 0x518 + (local.get $0) + ;; code offset: 0x51a + (local.get $1) + ) + ) + (func $12 (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + ;; code offset: 0x537 + (select + ;; code offset: 0x522 + (i32.const -1) + ;; code offset: 0x524 + (i32.const 0) + ;; code offset: 0x536 + (i32.ne + ;; code offset: 0x532 + (call $11 + ;; code offset: 0x526 + (local.get $0) + ;; code offset: 0x528 + (i32.const 1) + ;; code offset: 0x52e + (local.tee $2 + ;; code offset: 0x52c + (call $17 + ;; code offset: 0x52a + (local.get $0) + ) + ) + ;; code offset: 0x530 + (local.get $1) + ) + ;; code offset: 0x534 + (local.get $2) + ) + ) + ) + (func $13 (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + ;; code offset: 0x549 + (global.set $global$0 + ;; code offset: 0x547 + (local.tee $3 + ;; code offset: 0x546 + (i32.sub + ;; code offset: 0x542 + (global.get $global$0) + ;; code offset: 0x544 + (i32.const 16) + ) + ) + ) + ;; code offset: 0x54f + (i32.store8 offset=15 + ;; code offset: 0x54b + (local.get $3) + ;; code offset: 0x54d + (local.get $1) + ) + ;; code offset: 0x552 + (block $label$1 + ;; code offset: 0x55c + (if + ;; code offset: 0x55b + (i32.eqz + ;; code offset: 0x559 + (local.tee $2 + ;; code offset: 0x556 + (i32.load offset=16 + ;; code offset: 0x554 + (local.get $0) + ) + ) + ) + (block + ;; code offset: 0x560 + (local.set $2 + ;; code offset: 0x55e + (i32.const -1) + ) + ;; code offset: 0x566 + (br_if $label$1 + ;; code offset: 0x564 + (call $8 + ;; code offset: 0x562 + (local.get $0) + ) + ) + ;; code offset: 0x56d + (local.set $2 + ;; code offset: 0x56a + (i32.load offset=16 + ;; code offset: 0x568 + (local.get $0) + ) + ) + ) + ) + ;; code offset: 0x570 + (block $label$3 + ;; code offset: 0x57c + (br_if $label$3 + ;; code offset: 0x57b + (i32.ge_u + ;; code offset: 0x577 + (local.tee $4 + ;; code offset: 0x574 + (i32.load offset=20 + ;; code offset: 0x572 + (local.get $0) + ) + ) + ;; code offset: 0x579 + (local.get $2) + ) + ) + ;; code offset: 0x58c + (br_if $label$3 + ;; code offset: 0x58b + (i32.eq + ;; code offset: 0x584 + (local.tee $2 + ;; code offset: 0x583 + (i32.and + ;; code offset: 0x57e + (local.get $1) + ;; code offset: 0x580 + (i32.const 255) + ) + ) + ;; code offset: 0x588 + (i32.load8_s offset=75 + ;; code offset: 0x586 + (local.get $0) + ) + ) + ) + ;; code offset: 0x595 + (i32.store offset=20 + ;; code offset: 0x58e + (local.get $0) + ;; code offset: 0x594 + (i32.add + ;; code offset: 0x590 + (local.get $4) + ;; code offset: 0x592 + (i32.const 1) + ) + ) + ;; code offset: 0x59c + (i32.store8 + ;; code offset: 0x598 + (local.get $4) + ;; code offset: 0x59a + (local.get $1) + ) + ;; code offset: 0x59f + (br $label$1) + ) + ;; code offset: 0x5a4 + (local.set $2 + ;; code offset: 0x5a2 + (i32.const -1) + ) + ;; code offset: 0x5ba + (br_if $label$1 + ;; code offset: 0x5b9 + (i32.ne + ;; code offset: 0x5b4 + (call_indirect (type $i32_i32_i32_=>_i32) + ;; code offset: 0x5a6 + (local.get $0) + ;; code offset: 0x5ac + (i32.add + ;; code offset: 0x5a8 + (local.get $3) + ;; code offset: 0x5aa + (i32.const 15) + ) + ;; code offset: 0x5ad + (i32.const 1) + ;; code offset: 0x5b1 + (i32.load offset=36 + ;; code offset: 0x5af + (local.get $0) + ) + ) + ;; code offset: 0x5b7 + (i32.const 1) + ) + ) + ;; code offset: 0x5c1 + (local.set $2 + ;; code offset: 0x5be + (i32.load8_u offset=15 + ;; code offset: 0x5bc + (local.get $3) + ) + ) + ) + ;; code offset: 0x5c9 + (global.set $global$0 + ;; code offset: 0x5c8 + (i32.add + ;; code offset: 0x5c4 + (local.get $3) + ;; code offset: 0x5c6 + (i32.const 16) + ) + ) + ;; code offset: 0x5cb + (local.get $2) + ) + (func $14 (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + ;; code offset: 0x5e2 + (if + ;; code offset: 0x5e1 + (i32.ge_s + ;; code offset: 0x5dc + (i32.load offset=76 + ;; code offset: 0x5da + (local.tee $1 + ;; code offset: 0x5d7 + (i32.load + ;; code offset: 0x5d4 + (i32.const 1040) + ) + ) + ) + ;; code offset: 0x5df + (i32.const 0) + ) + ;; code offset: 0x5e8 + (local.set $2 + ;; code offset: 0x5e6 + (call $15 + ;; code offset: 0x5e4 + (local.get $1) + ) + ) + ) + ;; code offset: 0x636 + (local.set $0 + ;; code offset: 0x5eb + (block $label$2 (result i32) + ;; code offset: 0x5fa + (drop + ;; code offset: 0x5f8 + (br_if $label$2 + ;; code offset: 0x5ed + (i32.const -1) + ;; code offset: 0x5f7 + (i32.lt_s + ;; code offset: 0x5f3 + (call $12 + ;; code offset: 0x5ef + (local.get $0) + ;; code offset: 0x5f1 + (local.get $1) + ) + ;; code offset: 0x5f5 + (i32.const 0) + ) + ) + ) + ;; code offset: 0x5fb + (block $label$3 + ;; code offset: 0x605 + (br_if $label$3 + ;; code offset: 0x604 + (i32.eq + ;; code offset: 0x5ff + (i32.load8_u offset=75 + ;; code offset: 0x5fd + (local.get $1) + ) + ;; code offset: 0x602 + (i32.const 10) + ) + ) + ;; code offset: 0x614 + (br_if $label$3 + ;; code offset: 0x613 + (i32.ge_u + ;; code offset: 0x60c + (local.tee $0 + ;; code offset: 0x609 + (i32.load offset=20 + ;; code offset: 0x607 + (local.get $1) + ) + ) + ;; code offset: 0x610 + (i32.load offset=16 + ;; code offset: 0x60e + (local.get $1) + ) + ) + ) + ;; code offset: 0x61d + (i32.store offset=20 + ;; code offset: 0x616 + (local.get $1) + ;; code offset: 0x61c + (i32.add + ;; code offset: 0x618 + (local.get $0) + ;; code offset: 0x61a + (i32.const 1) + ) + ) + ;; code offset: 0x624 + (i32.store8 + ;; code offset: 0x620 + (local.get $0) + ;; code offset: 0x622 + (i32.const 10) + ) + ;; code offset: 0x629 + (br $label$2 + ;; code offset: 0x627 + (i32.const 0) + ) + ) + ;; code offset: 0x634 + (i32.shr_s + ;; code offset: 0x630 + (call $13 + ;; code offset: 0x62c + (local.get $1) + ;; code offset: 0x62e + (i32.const 10) + ) + ;; code offset: 0x632 + (i32.const 31) + ) + ) + ) + ;; code offset: 0x63a + (if + ;; code offset: 0x638 + (local.get $2) + ;; code offset: 0x63e + (call $16 + ;; code offset: 0x63c + (local.get $1) + ) + ) + ;; code offset: 0x641 + (local.get $0) + ) + (func $15 (param $0 i32) (result i32) + ;; code offset: 0x646 + (i32.const 1) + ) + (func $16 (param $0 i32) + ;; code offset: 0x64b + (nop) + ) + (func $17 (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + ;; code offset: 0x658 + (local.set $1 + ;; code offset: 0x656 + (local.get $0) + ) + ;; code offset: 0x65a + (block $label$1 + (block $label$2 + ;; code offset: 0x664 + (br_if $label$2 + ;; code offset: 0x663 + (i32.eqz + ;; code offset: 0x662 + (i32.and + ;; code offset: 0x65e + (local.get $0) + ;; code offset: 0x660 + (i32.const 3) + ) + ) + ) + ;; code offset: 0x66c + (if + ;; code offset: 0x66b + (i32.eqz + ;; code offset: 0x668 + (i32.load8_u + ;; code offset: 0x666 + (local.get $0) + ) + ) + ;; code offset: 0x670 + (return + ;; code offset: 0x66e + (i32.const 0) + ) + ) + ;; code offset: 0x672 + (loop $label$4 + ;; code offset: 0x67f + (br_if $label$2 + ;; code offset: 0x67e + (i32.eqz + ;; code offset: 0x67d + (i32.and + ;; code offset: 0x679 + (local.tee $1 + ;; code offset: 0x678 + (i32.add + ;; code offset: 0x674 + (local.get $1) + ;; code offset: 0x676 + (i32.const 1) + ) + ) + ;; code offset: 0x67b + (i32.const 3) + ) + ) + ) + ;; code offset: 0x686 + (br_if $label$4 + ;; code offset: 0x683 + (i32.load8_u + ;; code offset: 0x681 + (local.get $1) + ) + ) + ) + ;; code offset: 0x689 + (br $label$1) + ) + ;; code offset: 0x68c + (loop $label$5 + ;; code offset: 0x695 + (local.set $1 + ;; code offset: 0x694 + (i32.add + ;; code offset: 0x690 + (local.tee $2 + ;; code offset: 0x68e + (local.get $1) + ) + ;; code offset: 0x692 + (i32.const 4) + ) + ) + ;; code offset: 0x6b2 + (br_if $label$5 + ;; code offset: 0x6b1 + (i32.eqz + ;; code offset: 0x6b0 + (i32.and + ;; code offset: 0x6a9 + (i32.and + ;; code offset: 0x6a0 + (i32.xor + ;; code offset: 0x69c + (local.tee $3 + ;; code offset: 0x699 + (i32.load + ;; code offset: 0x697 + (local.get $2) + ) + ) + ;; code offset: 0x69e + (i32.const -1) + ) + ;; code offset: 0x6a8 + (i32.add + ;; code offset: 0x6a1 + (local.get $3) + ;; code offset: 0x6a3 + (i32.const -16843009) + ) + ) + ;; code offset: 0x6aa + (i32.const -2139062144) + ) + ) + ) + ) + ;; code offset: 0x6bc + (if + ;; code offset: 0x6bb + (i32.eqz + ;; code offset: 0x6ba + (i32.and + ;; code offset: 0x6b5 + (local.get $3) + ;; code offset: 0x6b7 + (i32.const 255) + ) + ) + ;; code offset: 0x6c3 + (return + ;; code offset: 0x6c2 + (i32.sub + ;; code offset: 0x6be + (local.get $2) + ;; code offset: 0x6c0 + (local.get $0) + ) + ) + ) + ;; code offset: 0x6c5 + (loop $label$7 + ;; code offset: 0x6cc + (local.set $3 + ;; code offset: 0x6c9 + (i32.load8_u offset=1 + ;; code offset: 0x6c7 + (local.get $2) + ) + ) + ;; code offset: 0x6d5 + (local.set $2 + ;; code offset: 0x6d3 + (local.tee $1 + ;; code offset: 0x6d2 + (i32.add + ;; code offset: 0x6ce + (local.get $2) + ;; code offset: 0x6d0 + (i32.const 1) + ) + ) + ) + ;; code offset: 0x6d9 + (br_if $label$7 + ;; code offset: 0x6d7 + (local.get $3) + ) + ) + ) + ;; code offset: 0x6e1 + (i32.sub + ;; code offset: 0x6dd + (local.get $1) + ;; code offset: 0x6df + (local.get $0) + ) + ) + (func $18 (result i32) + ;; code offset: 0x6e5 + (global.get $global$0) + ) + (func $19 (param $0 i32) + ;; code offset: 0x6ec + (global.set $global$0 + ;; code offset: 0x6ea + (local.get $0) + ) + ) + (func $20 (param $0 i32) (result i32) + (local $1 i32) + ;; code offset: 0x6fd + (global.set $global$0 + ;; code offset: 0x6fb + (local.tee $1 + ;; code offset: 0x6fa + (i32.and + ;; code offset: 0x6f7 + (i32.sub + ;; code offset: 0x6f3 + (global.get $global$0) + ;; code offset: 0x6f5 + (local.get $0) + ) + ;; code offset: 0x6f8 + (i32.const -16) + ) + ) + ) + ;; code offset: 0x6ff + (local.get $1) + ) + (func $21 (param $0 i32) (param $1 i32) (param $2 i64) (param $3 i32) (result i64) + ;; code offset: 0x70c + (call_indirect (type $i32_i64_i32_=>_i64) + ;; code offset: 0x704 + (local.get $1) + ;; code offset: 0x706 + (local.get $2) + ;; code offset: 0x708 + (local.get $3) + ;; code offset: 0x70a + (local.get $0) + ) + ) + (func $22 (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) + (local $5 i64) + ;; code offset: 0x72c + (call $fimport$2 + ;; code offset: 0x72b + (i32.wrap_i64 + ;; code offset: 0x72a + (i64.shr_u + ;; code offset: 0x726 + (local.tee $5 + ;; code offset: 0x724 + (call $21 + ;; code offset: 0x714 + (local.get $0) + ;; code offset: 0x716 + (local.get $1) + ;; code offset: 0x721 + (i64.or + ;; code offset: 0x71a + (i64.extend_i32_u + ;; code offset: 0x718 + (local.get $2) + ) + ;; code offset: 0x720 + (i64.shl + ;; code offset: 0x71d + (i64.extend_i32_u + ;; code offset: 0x71b + (local.get $3) + ) + ;; code offset: 0x71e + (i64.const 32) + ) + ) + ;; code offset: 0x722 + (local.get $4) + ) + ) + ;; code offset: 0x728 + (i64.const 32) + ) + ) + ) + ;; code offset: 0x730 + (i32.wrap_i64 + ;; code offset: 0x72e + (local.get $5) + ) + ) + (func $23 (param $0 i32) (result i32) + ;; code offset: 0x736 + (memory.grow + ;; code offset: 0x734 + (local.get $0) + ) + ) + ;; custom section ".debug_info", size 79 + ;; custom section ".debug_abbrev", size 64 + ;; custom section ".debug_line", size 53 + ;; custom section ".debug_str", size 206 +) diff --git a/test/passes/reverse_dwarf_abbrevs.passes b/test/passes/reverse_dwarf_abbrevs.passes new file mode 100644 index 000000000..8b1cab885 --- /dev/null +++ b/test/passes/reverse_dwarf_abbrevs.passes @@ -0,0 +1 @@ +roundtrip_dwarfdump_g diff --git a/test/passes/reverse_dwarf_abbrevs.wasm b/test/passes/reverse_dwarf_abbrevs.wasm Binary files differnew file mode 100644 index 000000000..9b9d89f57 --- /dev/null +++ b/test/passes/reverse_dwarf_abbrevs.wasm diff --git a/third_party/llvm-project/DWARFVisitor.cpp b/third_party/llvm-project/DWARFVisitor.cpp index 4b6ed5ada..22df78639 100644 --- a/third_party/llvm-project/DWARFVisitor.cpp +++ b/third_party/llvm-project/DWARFVisitor.cpp @@ -101,19 +101,19 @@ template <typename T> void DWARFYAML::VisitorImpl<T>::traverseDebugInfo() { if (Unit.Entries.empty()) { // XXX BINARYEN continue; } - auto FirstAbbrevCode = Unit.Entries[0].AbbrCode; for (auto &Entry : Unit.Entries) { onStartDIE(Unit, Entry); if (Entry.AbbrCode == 0u) continue; - // XXX BINARYEN - if (Entry.AbbrCode - FirstAbbrevCode + AbbrevStart >= AbbrevEnd) { + // XXX BINARYEN valid abbreviation codes start from 1, so subtract that, + // and are relative to the start of the abbrev table + auto RelativeAbbrIndex = Entry.AbbrCode - 1 + AbbrevStart; + if (RelativeAbbrIndex >= AbbrevEnd) { errs() << "warning: invalid abbreviation code " << Entry.AbbrCode - << " (range: " << FirstAbbrevCode << " : " << AbbrevStart - << ".." << AbbrevEnd << ")\n"; + << " (range: " << AbbrevStart << ".." << AbbrevEnd << ")\n"; continue; } - auto &Abbrev = DebugInfo.AbbrevDecls[Entry.AbbrCode - FirstAbbrevCode + AbbrevStart]; + auto &Abbrev = DebugInfo.AbbrevDecls[RelativeAbbrIndex]; auto FormVal = Entry.Values.begin(); auto AbbrForm = Abbrev.Attributes.begin(); for (; |